Summary

The cluster() GraphQL query returns information about a cluster.

API Stability Long-Term

Syntax

graphql
cluster(): Cluster!

There is no input for this query field. For the results, specify the cluster information you want, such as details on nodes, cluster statistics, or ingest partitions.

Example

Raw
graphql
query {
	cluster {
	  nodes {
        id, name, 
        isAvailable, lastHeartbeat,
        targetSize, primarySize },
      clusterInfoAgeSeconds,
      clusterManagementSettings { allowRebalanceExistingSegments }
      stats{ compressedByteSize, uncompressedByteSize }
	}
}
Mac OS or Linux (curl)
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "query {
	cluster {
	  nodes {
        id, name, 
        isAvailable, lastHeartbeat,
        targetSize, primarySize },
      clusterInfoAgeSeconds,
      clusterManagementSettings { allowRebalanceExistingSegments }
      stats{ compressedByteSize, uncompressedByteSize }
	}
}"
}
EOF
Mac OS or Linux (curl) One-line
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "query {
	cluster {
	  nodes {
        id, name, 
        isAvailable, lastHeartbeat,
        targetSize, primarySize },
      clusterInfoAgeSeconds,
      clusterManagementSettings { allowRebalanceExistingSegments }
      stats{ compressedByteSize, uncompressedByteSize }
	}
}"
}
EOF
Windows Cmd and curl
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json" ^
    -d @'{"query" : "query { ^
	cluster { ^
	  nodes { ^
        id, name,  ^
        isAvailable, lastHeartbeat, ^
        targetSize, primarySize }, ^
      clusterInfoAgeSeconds, ^
      clusterManagementSettings { allowRebalanceExistingSegments } ^
      stats{ compressedByteSize, uncompressedByteSize } ^
	} ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "query {
	cluster {
	  nodes {
        id, name, 
        isAvailable, lastHeartbeat,
        targetSize, primarySize },
      clusterInfoAgeSeconds,
      clusterManagementSettings { allowRebalanceExistingSegments }
      stats{ compressedByteSize, uncompressedByteSize }
	}
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $query = "query {
	cluster {
	  nodes {
        id, name, 
        isAvailable, lastHeartbeat,
        targetSize, primarySize },
      clusterInfoAgeSeconds,
      clusterManagementSettings { allowRebalanceExistingSegments }
      stats{ compressedByteSize, uncompressedByteSize }
	}
}";
$query =~ s/\n/ /g;
my $json = sprintf('{"query" : "%s"}',$query);
my $req = HTTP::Request->new("POST", $uri );

$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");

$req->content( $json );

my $lwp = LWP::UserAgent->new;

my $result = $lwp->request( $req );

print $result->{"_content"},"\n";
Python
python
#! /usr/local/bin/python3

import requests

url = '$YOUR_LOGSCALE_URL/graphql'
mydata = r'''{"query" : "query {
	cluster {
	  nodes {
        id, name, 
        isAvailable, lastHeartbeat,
        targetSize, primarySize },
      clusterInfoAgeSeconds,
      clusterManagementSettings { allowRebalanceExistingSegments }
      stats{ compressedByteSize, uncompressedByteSize }
	}
}"
}'''

resp = requests.post(url,
                     data = mydata,
                     headers = {
   "Authorization" : "Bearer $TOKEN",
   "Content-Type" : "application/json"
}
)

print(resp.text)
Node.js
javascript
const https = require('https');

const data = JSON.stringify(
    {"query" : "query {
	cluster {
	  nodes {
        id, name, 
        isAvailable, lastHeartbeat,
        targetSize, primarySize },
      clusterInfoAgeSeconds,
      clusterManagementSettings { allowRebalanceExistingSegments }
      stats{ compressedByteSize, uncompressedByteSize }
	}
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL',
  path: 'graphql',
  port: 443,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Authorization: 'BEARER ' + process.env.TOKEN,
    'User-Agent': 'Node',
  },
};

const req = https.request(options, (res) => {
  let data = '';
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    data += d;
  });
  res.on('end', () => {
    console.log(JSON.parse(data).data);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();
Example Responses
Success (HTTP Response Code 200 OK)
json
{
  "data": {
    "cluster": {
      "nodes": [
        {
          "name": "localhost:8080",
          "primarySize": 0.1325218,
          "lastHeartbeat": "2024-09-02T09:37:25.387Z",
          "targetSize": 0.105984672,
          "id": 1,
          "isAvailable": true
        }
      ],
      "clusterInfoAgeSeconds": 0.935,
      "clusterManagementSettings": {
        "allowRebalanceExistingSegments": true
      },
      "stats": {
        "compressedByteSize": 133674640,
        "uncompressedByteSize": 1797456088
      }
    }
  }
}

Notice that some returned values require sub-parameters. For instance, nodes has sub-values such as isAvailable. These can be separated by commas, but commas are not required when each value is on its own line (for example, there is no comma before stats).

Returned Values

The Cluster datatype covers several categories of information: node details (nodes), replication health metrics (underReplicatedSegmentSize, properlyReplicatedSegmentSize, missingSegmentSize, overReplicatedSegmentSize, and related target and bucket storage fields), ingest partition data (ingestPartitions), cluster performance statistics (stats), replication factors (storageReplicationFactor, digestReplicationFactor), cluster management settings (clusterManagementSettings), and the default cache policy (defaultCachePolicy). Node identifiers obtained here can be used with other queries and mutations that target specific nodes. The available fields are listed here:

Table: Cluster Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
Some input parameters may be required, as indicated in the Required column. For return values, this indicates that you are assured a value if the field is requested for the results. 
Table last updated: Oct 14, 2026 
clusterInfoAgeSecondsFloatyes Long-Term The age of the cluster information in seconds.
clusterManagementSettingsClusterManagementSettingsyes Long-Term The settings for the LogScale cluster (see See ClusterManagementSettings.
defaultCachePolicyCachePolicy  Short-Term The default cache policy. See CachePolicy. Cache policies are a limited preview feature and subject to change.
digestReplicationFactorInt  Short-Term The digest replication factor.
inBucketStorageSegmentSizeFloatyes Long-Term The in bucket storage segment size.
ingestPartitionsIngestPartitionyes Long-Term The ingest partitions. See IngestPartition.
missingSegmentSizeFloatyes Long-Term The missing segment size.
nodesClusterNodeyes Long-Term The nodes of the cluster. See ClusterNode.
overReplicatedSegmentSizeFloatyes Long-Term The over replicated segment size.
pendingBucketStorageRiskySegmentSizeFloatyes Long-Term The pending bucket storage risky segment size.
pendingBucketStorageSegmentSizeFloatyes Long-Term The pending bucket storage segment size.
properlyReplicatedSegmentSizeFloatyes Long-Term The properly replicated segment size.
statsClusterStatsyes Short-Term The cluster statistics. See ClusterStats.
storageReplicationFactorInt  Short-Term The storage replication factor.
targetMissingSegmentSizeFloatyes Long-Term The target missing segment size.
targetOverReplicatedSegmentSizeFloatyes Long-Term The target over replicated segment size.
targetProperlyReplicatedSegmentSizeFloatyes Long-Term The target properly replicated segment size.
targetUnderReplicatedSegmentSizeFloatyes Long-Term The target under replicated segment size.
underReplicatedSegmentSizeFloatyes Long-Term The under replicated segment size.