Get cluster statistics Generally available; Added in 1.3.0

GET /_cluster/stats/nodes/{node_id}

All methods and paths for this operation:

GET /_cluster/stats

GET /_cluster/stats/nodes/{node_id}

Get basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins).

Required authorization

  • Cluster privileges: monitor

Path parameters

  • node_id string | array[string] Required

    Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster.

Query parameters

  • include_remotes boolean

    Include remote cluster data into the response

  • timeout string

    Period to wait for each node to respond. If a node does not respond before its timeout expires, the response does not include its stats. However, timed out nodes are included in the response’s _nodes.failed property. Defaults to no timeout.

    External documentation

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • _nodes object

      Contains statistics about the number of nodes selected by the request’s node filters.

      Hide _nodes attributes Show _nodes attributes object
      • failures array[object]

        Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

        Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

      • total number Required

        Total number of nodes selected by the request.

      • successful number Required

        Number of nodes that responded successfully to the request.

      • failed number Required

        Number of nodes that rejected the request or failed to respond. If this value is not 0, a reason for the rejection or failure is included in the response.

    • cluster_name string Required

      Name of the cluster, based on the cluster name setting.

    • cluster_uuid string Required

      Unique identifier for the cluster.

    • indices object Required

      Contains statistics about indices with shards assigned to selected nodes.

      Hide indices attributes Show indices attributes object
      • analysis object

        Contains statistics about analyzers and analyzer components used in selected nodes.

      • completion object

        Contains statistics about memory used for completion in selected nodes.

      • count number Required

        Total number of indices with shards assigned to selected nodes.

      • docs object

        Contains counts for documents in selected nodes.

      • fielddata object

        Contains statistics about the field data cache of selected nodes.

      • query_cache object

        Contains statistics about the query cache of selected nodes.

      • segments object

        Contains statistics about segments in selected nodes.

      • shards object

        Contains statistics about indices with shards assigned to selected nodes.

      • store object

        Contains statistics about the size of shards assigned to selected nodes.

      • mappings object

        Contains statistics about field mappings in selected nodes.

      • versions array[object]

        Contains statistics about analyzers and analyzer components used in selected nodes.

      • dense_vector object

        Contains statistics about indexed dense vector

      • sparse_vector object

        Contains statistics about indexed sparse vector

    • nodes object Required

      Contains statistics about nodes selected by the request’s node filters.

      Hide nodes attributes Show nodes attributes object
      • count object

        Contains counts for nodes selected by the request’s node filters.

      • discovery_types object Required

        Contains statistics about the discovery types used by selected nodes.

        Hide discovery_types attribute Show discovery_types attribute object
        • * number Additional properties
      • fs object

        Contains statistics about file stores by selected nodes.

      • indexing_pressure object
      • ingest object
      • jvm object

        Contains statistics about the Java Virtual Machines (JVMs) used by selected nodes.

      • network_types object

        Contains statistics about the transport and HTTP networks used by selected nodes.

      • os object

        Contains statistics about the operating systems used by selected nodes.

      • packaging_types array[object] Required

        Contains statistics about Elasticsearch distributions installed on selected nodes.

      • plugins array[object] Required

        Contains statistics about installed plugins and modules by selected nodes. If no plugins or modules are installed, this array is empty.

      • process object

        Contains statistics about processes used by selected nodes.

      • versions array[string] Required

        Array of Elasticsearch versions used on selected nodes.

    • repositories object Required

      Contains stats on repository feature usage exposed in cluster stats for telemetry.

      Hide repositories attribute Show repositories attribute object
      • * object Additional properties
        Hide * attribute Show * attribute object
        • * number Additional properties
    • snapshots object Required

      Contains stats cluster snapshots.

      Hide snapshots attributes Show snapshots attributes object
      • current_counts object
      • repositories object Required
        Hide repositories attribute Show repositories attribute object
        • * object Additional properties
    • status string

      Health status of the cluster, based on the state of its primary and replica shards.

      Supported values include:

      • green (or GREEN): All shards are assigned.
      • yellow (or YELLOW): All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.
      • red (or RED): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.
      • unknown
      • unavailable

      Values are green, GREEN, yellow, YELLOW, red, RED, unknown, or unavailable.

    • timestamp number Required

      Unix timestamp, in milliseconds, for the last time the cluster statistics were refreshed.

    • ccs object Required

      Cross-cluster stats

      Hide ccs attributes Show ccs attributes object
      • clusters object

        Contains remote cluster settings and metrics collected from them. The keys are cluster names, and the values are per-cluster data. Only present if include_remotes option is set to true.

        Hide clusters attribute Show clusters attribute object
        • * object Additional properties
      • _esql object

        Information about ES|QL cross-cluster query usage.

GET /_cluster/stats/nodes/{node_id}
GET _cluster/stats?human&filter_path=indices.mappings.total_deduplicated_mapping_size*
resp = client.cluster.stats(
    human=True,
    filter_path="indices.mappings.total_deduplicated_mapping_size*",
)
const response = await client.cluster.stats({
  human: "true",
  filter_path: "indices.mappings.total_deduplicated_mapping_size*",
});
response = client.cluster.stats(
  human: "true",
  filter_path: "indices.mappings.total_deduplicated_mapping_size*"
)
$resp = $client->cluster()->stats([
    "human" => "true",
    "filter_path" => "indices.mappings.total_deduplicated_mapping_size*",
]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cluster/stats?human&filter_path=indices.mappings.total_deduplicated_mapping_size*"
client.cluster().stats(s -> s);