Type to search.

Get index statistics

Auth The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 1.3 This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

For data streams, the API retrieves statistics for the stream's backing indices.

By default, the returned statistics are index-level with primaries and total aggregations. primaries are the values for only the primary shards. total are the accumulated values for both primary and replica shards.

To get shard-level statistics, set the level parameter to shards.

Note

When moving to another node, the shard-level statistics for a shard are cleared. Although the shard is no longer part of the node, that node retains any node-level statistics to which the shard contributed.

Required privileges

Index privileges monitor

Path parameters

index union string | string[] optional

A comma-separated list of index names; use _all or empty string to perform the operation on all indices

Leave it out to use /_stats.

metric union string | string[] optional

Limit the information returned the specific metrics

Leave it out to use /_stats.

Query parameters

completion_fields union string | string[]

Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics.

expand_wildcards union oneOf · default: open

Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden.

Supported values include:

  • all: Match any data stream or index, including hidden ones.
  • open: Match open, non-hidden indices. Also matches any non-hidden data stream.
  • closed: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
  • hidden: Match hidden data streams and hidden indices. Must be combined with open, closed, or both.
  • none: Wildcard expressions are not accepted.
Values: all open closed hidden none
fielddata_fields union string | string[]

Comma-separated list or wildcard expressions of fields to include in fielddata statistics.

fields union string | string[]

Comma-separated list or wildcard expressions of fields to include in the statistics.

forbid_closed_indices boolean · default: true

If true, statistics are not collected from closed indices.

groups union string | string[]

Comma-separated list of search groups to include in the search statistics.

include_segment_file_sizes boolean · default: false

If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).

include_unloaded_segments boolean · default: false

If true, the response includes information from segments that are not loaded into memory.

level enum · default: indices

Indicates whether statistics are aggregated at the cluster, indices, or shards level.

Values: cluster indices shards

Response

application/json
indices map string to object
_shards object required
failed number required

The number of shards the operation or search attempted to run on but failed.

successful number required

The number of shards the operation or search succeeded on.

total number required

The number of shards the operation or search will run on overall.

skipped number
_all object required
shards map string to object
total object
Same fields as primaries in _all
uuid string
health enum The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 8.1 This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

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: green GREEN yellow YELLOW red RED unknown unavailable
status enum The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 8.1 This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Values: open close