cluster()

API Stability Long-Term

The cluster() GraphQL query is used to retrieve information about a cluster.

For information on managing and monitoring clusters, see the Cluster Management page in the main documentation. You may also want to look at the LogScale Logical Architecture page, which provides graphics and details on how clusters work in LogScale.

Related to cluster management, see the clusterManagementSettings() query. There are a few mutation fields related to clusters: createLocalClusterConnection() and updateLocalClusterConnection() for local connections; createRemoteClusterConnection() and updateRemoteClusterConnection() for remote connections; and clusterUnregisterNode() and deleteClusterConnection() for removing a node, temporarily and permanently.

Syntax

graphql
cluster: Cluster!

There is no input for this query field, just what information on the cluster you want returned, such as details on all of the nodes (e.g., cluster statistics, ingest partitions, etc.).

Example

Below is an example with several values requested:

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 in the example above that some value requests required sub-requests. For instance, nodes has a few values of its own that were requested, like isAvailable. These are all separated by commas, but that's not necessary if each is followed by a hard-return (e.g., there's no comma before stats).

Returned Datatype

The returned datatype is used to select the results you want returned. This can include information on the cluster itself and on the individual nodes, by way of the sub-parameter that uses the ClusterNode datatype. With this extension you get the unique identifier and name of all of the nodes in the cluster — which you can use with other query and mutation fields to learn more about a specific node, as well as make changes. To see all of your choices, click on the link for that sub-datatype in the table below, where all of the parameters for this datatype are listed:

Table: Cluster

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For return datatypes, this indicates that you must specify which fields you want returned in the results.
Table last updated: Aug 19, 2025
clusterInfoAgeSecondsfloatyes Long-TermThe age of the cluster information in seconds.
clusterManagementSettingsClusterManagementSettingsyes Long-TermThe settings for the LogScale cluster (see See ClusterManagementSettings.
defaultCachePolicyCachePolicy  PreviewThe default cache policy. See CachePolicy. Cache policies are a limited preview feature and subject to change.
digestReplicationFactorinteger  Short-TermThe digest replication factor.
inBucketStorageSegmentSizefloatyes Long-TermThe in bucket storage segment size.
ingestPartitions[IngestPartition]yes Long-TermThe ingest partitions. See IngestPartition.
missingSegmentSizefloatyes Long-TermThe missing segment size.
nodes[ClusterNode]yes Long-TermThe nodes of the cluster. See ClusterNode.
overReplicatedSegmentSizefloatyes Long-TermThe over replicated segment size.
pendingBucketStorageRiskySegmentSizefloatyes Long-TermThe pending bucket storage risky segment size.
pendingBucketStorageSegmentSizefloatyes Long-TermThe pending bucket storage segment size.
properlyReplicatedSegmentSizefloatyes Long-TermThe properly replicated segment size.
statsClusterStatsyes Short-TermThe cluster statistics. See ClusterStats.
storageReplicationFactorinteger  Short-TermThe storage replication factor.
targetMissingSegmentSizefloatyes Long-TermThe target missing segment size.
targetOverReplicatedSegmentSizefloatyes Long-TermThe target over replicated segment size.
targetProperlyReplicatedSegmentSizefloatyes Long-TermThe target properly replicated segment size.
targetUnderReplicatedSegmentSizefloatyes Long-TermThe target under replicated segment size.
underReplicatedSegmentSizefloatyes Long-TermThe under replicated segment size.