Get index statistics
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.
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 authorization
- Index privileges monitor
Path parameters
-
indexstring | stringoptional -
A comma-separated list of index names; use
_allor empty string to perform the operation on all indicesLeave it out to use
/_stats. -
metricenum | enumoptional -
Comma-separated list of metrics used to limit the request.
Supported values include:
_all: Return all statistics.store: Size of the index in byte units.indexing: Indexing statistics.get: Get statistics, including missing stats.search: Search statistics including suggest statistics. You can include statistics for custom groups by adding an extragroupsparameter (search operations can be associated with one or more groups). Thegroupsparameter accepts a comma-separated list of group names. Use_allto return statistics for all groups.merge: Merge statistics.flush: Flush statistics.refresh: Refresh statistics.query_cache: Query cache statistics.fielddata: Fielddata statistics.docs: Number of documents and deleted docs not yet merged out. Index refreshes can affect this statistic.warmer: Index warming statistics.completion: Completion suggester statistics.segments: Memory use of all open segments. If theinclude_segment_file_sizesparameter istrue, this metric includes the aggregated disk usage of each Lucene index file.translog: Translog statistics.request_cache: Shard request cache statistics.recovery: Recovery statistics.bulk: Bulk operations statistics.shard_stats: Shard statistics, including the total number of shards.mappings: Mapping statistics, including the total count and estimated overhead.dense_vector: Total number of dense vectors indexed. Index refreshes can affect this statistic.sparse_vector: Total number of sparse vectors indexed. Index refreshes can affect this statistic.
Leave it out to use
/_stats. -
Values:
_allstoreindexinggetsearchmergeflushrefreshquery_cachefielddatadocswarmercompletionsegmentstranslogrequest_cacherecoverybulkshard_statsmappingsdense_vectorsparse_vector
Query parameters
-
completion_fieldsoneOf -
Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics.
-
expand_wildcardsstring · 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 withopen,closed, orboth.none: Wildcard expressions are not accepted.
-
Values:
allopenclosedhiddennone -
fielddata_fieldsoneOf -
Comma-separated list or wildcard expressions of fields to include in fielddata statistics.
-
forbid_closed_indicesboolean · default: true -
If true, statistics are not collected from closed indices.
-
include_segment_file_sizesboolean · 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).
Response
-
indicesmap string to object -
<string>object -
primariesobject -
docsobject -
Contains statistics about documents across all primary shards assigned to the node.
-
countnumberrequired -
Total number of non-deleted documents across all primary shards assigned to selected nodes. This number is based on documents in Lucene segments and may include documents from nested fields.
-
deletednumber -
Total number of deleted documents across all primary shards assigned to selected nodes. This number is based on documents in Lucene segments. Elasticsearch reclaims the disk space of deleted Lucene documents when a segment is merged.
-
fielddataobject -
Contains statistics about the field data cache across all shards assigned to the node.
-
query_cacheobject -
Contains statistics about the query cache across all shards assigned to the node.
-
cache_countnumberrequired -
Total number of entries added to the query cache across all shards assigned to selected nodes. This number includes current and evicted entries.
-
cache_sizenumberrequired -
Total number of entries currently in the query cache across all shards assigned to selected nodes.
-
evictionsnumberrequired -
Total number of query cache evictions across all shards assigned to selected nodes.
-
hit_countnumberrequired -
Total count of query cache hits across all shards assigned to selected nodes.
-
memory_sizenumber | string -
Total amount of memory used for the query cache across all shards assigned to selected nodes.
-
memory_size_in_bytesnumberrequired -
Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes.
-
request_cacheobject -
Contains statistics about the request cache across all shards assigned to the node.
-
segmentsobject -
Contains statistics about segments across all shards assigned to the node.
-
doc_values_memorynumber | string -
Total amount of memory used for doc values across all shards assigned to selected nodes.
-
doc_values_memory_in_bytesnumberrequired -
Total amount, in bytes, of memory used for doc values across all shards assigned to selected nodes.
-
file_sizesmap string to objectrequired -
This object is not populated by the cluster stats API. To get information on segment files, use the node stats API.
-
fixed_bit_setnumber | string -
Total amount of memory used by fixed bit sets across all shards assigned to selected nodes. Fixed bit sets are used for nested object field types and type filters for join fields.
-
fixed_bit_set_memory_in_bytesnumberrequired -
Total amount of memory, in bytes, used by fixed bit sets across all shards assigned to selected nodes.
-
index_writer_memorynumber | string -
Total amount of memory used by all index writers across all shards assigned to selected nodes.
-
index_writer_memory_in_bytesnumberrequired -
Total amount, in bytes, of memory used by all index writers across all shards assigned to selected nodes.
-
max_unsafe_auto_id_timestampnumberrequired -
Unix timestamp, in milliseconds, of the most recently retried indexing request.
-
memorynumber | string -
Total amount of memory used for segments across all shards assigned to selected nodes.
-
memory_in_bytesnumberrequired -
Total amount, in bytes, of memory used for segments across all shards assigned to selected nodes.
-
norms_memorynumber | string -
Total amount of memory used for normalization factors across all shards assigned to selected nodes.
-
norms_memory_in_bytesnumberrequired -
Total amount, in bytes, of memory used for normalization factors across all shards assigned to selected nodes.
-
points_memorynumber | string -
Total amount of memory used for points across all shards assigned to selected nodes.
-
points_memory_in_bytesnumberrequired -
Total amount, in bytes, of memory used for points across all shards assigned to selected nodes.
-
stored_fields_memory_in_bytesnumberrequired -
Total amount, in bytes, of memory used for stored fields across all shards assigned to selected nodes.
-
stored_fields_memorynumber | string -
Total amount of memory used for stored fields across all shards assigned to selected nodes.
-
terms_memory_in_bytesnumberrequired -
Total amount, in bytes, of memory used for terms across all shards assigned to selected nodes.
-
terms_memorynumber | string -
Total amount of memory used for terms across all shards assigned to selected nodes.
-
term_vectors_memorynumber | string -
Total amount of memory used for term vectors across all shards assigned to selected nodes.
-
term_vectors_memory_in_bytesnumberrequired -
Total amount, in bytes, of memory used for term vectors across all shards assigned to selected nodes.
-
storeobject -
Contains statistics about the size of shards assigned to the node.
-
reservednumber | string -
A prediction of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities.
-
reserved_in_bytesnumberrequired -
A prediction, in bytes, of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities.
-
health -
Supported values include:
green(orGREEN): All shards are assigned.yellow(orYELLOW): 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(orRED): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.unknownunavailable
-
Values:
greenGREENyellowYELLOWredREDunknownunavailable -
_allobjectrequired -
primariesobject -
docsobject -
Contains statistics about documents across all primary shards assigned to the node.
-
countnumberrequired -
Total number of non-deleted documents across all primary shards assigned to selected nodes. This number is based on documents in Lucene segments and may include documents from nested fields.
-
deletednumber -
Total number of deleted documents across all primary shards assigned to selected nodes. This number is based on documents in Lucene segments. Elasticsearch reclaims the disk space of deleted Lucene documents when a segment is merged.
-
fielddataobject -
Contains statistics about the field data cache across all shards assigned to the node.
-
query_cacheobject -
Contains statistics about the query cache across all shards assigned to the node.
-
cache_countnumberrequired -
Total number of entries added to the query cache across all shards assigned to selected nodes. This number includes current and evicted entries.
-
cache_sizenumberrequired -
Total number of entries currently in the query cache across all shards assigned to selected nodes.
-
evictionsnumberrequired -
Total number of query cache evictions across all shards assigned to selected nodes.
-
hit_countnumberrequired -
Total count of query cache hits across all shards assigned to selected nodes.
-
memory_sizenumber | string -
Total amount of memory used for the query cache across all shards assigned to selected nodes.
-
memory_size_in_bytesnumberrequired -
Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes.
-
request_cacheobject -
Contains statistics about the request cache across all shards assigned to the node.
-
storeobject -
Contains statistics about the size of shards assigned to the node.
-
reservednumber | string -
A prediction of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities.
-
reserved_in_bytesnumberrequired -
A prediction, in bytes, of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities.
-
health -
Supported values include:
green(orGREEN): All shards are assigned.yellow(orYELLOW): 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(orRED): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.unknownunavailable
-
Values:
greenGREENyellowYELLOWredREDunknownunavailable