Get index statistics
- GET /{index}/_stats/{metric}
- GET /_stats/{metric}
- GET /{index}/_stats
- GET /_stats
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.
- Index privileges:
monitor
Path Parameters
-
indexIndexName | IndexNameoptional -
A comma-separated list of index names; use
_allor empty string to perform the operation on all indicesLeave it out to use
/_stats. -
metricCommonStatsFlag | CommonStatsFlagoptional -
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_fieldsFields Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics.
-
expand_wildcardsstring ExpandWildcards · 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_fieldsFields Comma-separated list or wildcard expressions of fields to include in fielddata statistics.
-
fieldsFields Comma-separated list or wildcard expressions of fields to include in the statistics.
-
forbid_closed_indicesboolean · default: true If true, statistics are not collected from closed indices.
-
groupsstring | string Comma-separated list of search groups to include in the search statistics.
-
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).
-
include_unloaded_segmentsboolean · default: false If true, the response includes information from segments that are not loaded into memory.
-
levelLevel · default: indices Indicates whether statistics are aggregated at the cluster, indices, or shards level.
-
Values:
clusterindicesshards
Response
-
indicesmap string to IndicesStats -
<string>IndicesStats -
primariesIndexStats -
completionCompletionStats -
Contains statistics about completions across all shards assigned to the node.
-
size_in_bytesnumberrequired -
Total amount, in bytes, of memory used for completion across all shards assigned to selected nodes.
-
sizenumber | string ByteSize -
Total amount of memory used for completion across all shards assigned to selected nodes.
-
fieldsmap string to FieldSizeUsage -
<string>FieldSizeUsage -
sizenumber | string ByteSize -
size_in_bytesnumberrequired -
docsDocStats -
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.
-
total_size_in_bytesnumberrequired -
Returns the total size in bytes of all documents in this stats. This value may be more reliable than store_stats.size_in_bytes in estimating the index size.
-
total_sizenumber | string ByteSize -
Human readable total_size_in_bytes
-
fielddataFielddataStats -
Contains statistics about the field data cache across all shards assigned to the node.
-
evictionsnumber -
memory_sizenumber | string ByteSize -
memory_size_in_bytesnumberrequired -
fieldsmap string to FieldMemoryUsage -
<string>FieldMemoryUsage -
memory_sizenumber | string ByteSize -
memory_size_in_bytesnumberrequired -
global_ordinalsGlobalOrdinalsStatsrequired -
build_time_in_millisnumberrequired -
build_timestring -
fieldsmap string to GlobalOrdinalFieldStats -
<string>GlobalOrdinalFieldStats -
build_time_in_millisnumberrequired -
build_timestring -
shard_max_value_countnumberrequired -
flushFlushStats -
Contains statistics about flush operations for the node.
-
periodicnumberrequired -
totalnumberrequired -
total_timestring Duration -
total_time_in_millisDurationValueUnitMillisrequired -
total_time_excluding_waitingstring Duration -
total_time_excluding_waiting_on_lock_in_millisDurationValueUnitMillisrequired -
getGetStats -
Contains statistics about get operations for the node.
-
currentnumberrequired -
exists_timestring Duration -
exists_time_in_millisDurationValueUnitMillisrequired -
exists_totalnumberrequired -
missing_timestring Duration -
missing_time_in_millisDurationValueUnitMillisrequired -
missing_totalnumberrequired -
getTimestring Duration -
time_in_millisDurationValueUnitMillisrequired -
totalnumberrequired -
indexingIndexingStats -
Contains statistics about indexing operations for the node.
-
index_currentnumberrequired -
delete_currentnumberrequired -
delete_timestring Duration -
delete_time_in_millisDurationValueUnitMillisrequired -
delete_totalnumberrequired -
is_throttledbooleanrequired -
noop_update_totalnumberrequired -
throttle_timestring Duration -
throttle_time_in_millisDurationValueUnitMillisrequired -
index_timestring Duration -
index_time_in_millisDurationValueUnitMillisrequired -
index_totalnumberrequired -
index_failednumberrequired -
index_failed_due_to_version_conflictnumberrequired -
typesmap string to IndexingStats -
write_loadnumber -
recent_write_loadnumber -
peak_write_loadnumber -
indicesIndicesStats -
Contains statistics about indices operations for the node.
-
mergesMergesStats -
Contains statistics about merge operations for the node.
-
currentnumberrequired -
current_docsnumberrequired -
current_sizestring -
current_size_in_bytesnumberrequired -
totalnumberrequired -
total_auto_throttlestring -
total_auto_throttle_in_bytesnumberrequired -
total_docsnumberrequired -
total_sizestring -
total_size_in_bytesnumberrequired -
total_stopped_timestring Duration -
total_stopped_time_in_millisDurationValueUnitMillisrequired -
total_throttled_timestring Duration -
total_throttled_time_in_millisDurationValueUnitMillisrequired -
total_timestring Duration -
total_time_in_millisDurationValueUnitMillisrequired -
query_cacheQueryCacheStats -
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 ByteSize -
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.
-
miss_countnumberrequired -
Total count of query cache misses across all shards assigned to selected nodes.
-
total_countnumberrequired -
Total count of hits and misses in the query cache across all shards assigned to selected nodes.
-
recoveryRecoveryStats -
Contains statistics about recovery operations for the node.
-
current_as_sourcenumberrequired -
current_as_source_queuednumber -
current_as_targetnumberrequired -
current_as_target_queuednumber -
current_from_storenumber -
current_from_store_queuednumber -
throttle_timestring Duration -
throttle_time_in_millisDurationValueUnitMillisrequired -
refreshRefreshStats -
Contains statistics about refresh operations for the node.
-
external_totalnumberrequired -
external_total_timestring Duration -
external_total_time_in_millisDurationValueUnitMillisrequired -
listenersnumberrequired -
totalnumberrequired -
total_timestring Duration -
total_time_in_millisDurationValueUnitMillisrequired -
request_cacheRequestCacheStats -
Contains statistics about the request cache across all shards assigned to the node.
-
evictionsnumberrequired -
hit_countnumberrequired -
memory_sizestring -
memory_size_in_bytesnumberrequired -
miss_countnumberrequired -
searchSearchStats -
Contains statistics about search operations for the node.
-
fetch_currentnumberrequired -
fetch_timestring Duration -
fetch_time_in_millisDurationValueUnitMillisrequired -
fetch_totalnumberrequired -
fetch_failurenumberrequired -
open_contextsnumber -
query_currentnumberrequired -
query_timestring Duration -
query_time_in_millisDurationValueUnitMillisrequired -
query_totalnumberrequired -
query_failurenumberrequired -
scroll_currentnumberrequired -
scroll_timestring Duration -
scroll_time_in_millisDurationValueUnitMillisrequired -
scroll_totalnumberrequired -
suggest_currentnumberrequired -
suggest_timestring Duration -
suggest_time_in_millisDurationValueUnitMillisrequired -
suggest_totalnumberrequired -
recent_search_loadnumber -
groupsmap string to SearchStats -
segmentsSegmentsStats -
Contains statistics about segments across all shards assigned to the node.
-
countnumberrequired -
Total number of segments across all shards assigned to selected nodes.
-
doc_values_memorynumber | string ByteSize -
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 ShardFileSizeInforequired -
This object is not populated by the cluster stats API. To get information on segment files, use the node stats API.
-
<string>ShardFileSizeInfo -
descriptionstringrequired -
size_in_bytesnumberrequired -
min_size_in_bytesnumber -
max_size_in_bytesnumber -
average_size_in_bytesnumber -
countnumber -
fixed_bit_setnumber | string ByteSize -
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 ByteSize -
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 ByteSize -
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 ByteSize -
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 ByteSize -
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 ByteSize -
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 ByteSize -
Total amount of memory used for terms across all shards assigned to selected nodes.
-
term_vectors_memorynumber | string ByteSize -
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.
-
version_map_memorynumber | string ByteSize -
Total amount of memory used by all version maps across all shards assigned to selected nodes.
-
version_map_memory_in_bytesnumberrequired -
Total amount, in bytes, of memory used by all version maps across all shards assigned to selected nodes.
-
storeStoreStats -
Contains statistics about the size of shards assigned to the node.
-
sizenumber | string ByteSize -
Total size of all shards assigned to selected nodes.
-
size_in_bytesnumberrequired -
Total size, in bytes, of all shards assigned to selected nodes.
-
reservednumber | string ByteSize -
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.
-
total_data_set_sizenumber | string ByteSize -
Total data set size of all shards assigned to selected nodes. This includes the size of shards not stored fully on the nodes, such as the cache for partially mounted indices.
-
total_data_set_size_in_bytesnumber -
Total data set size, in bytes, of all shards assigned to selected nodes. This includes the size of shards not stored fully on the nodes, such as the cache for partially mounted indices.
-
translogTranslogStats -
Contains statistics about transaction log operations for the node.
-
earliest_last_modified_agenumberrequired -
operationsnumberrequired -
sizestring -
size_in_bytesnumberrequired -
uncommitted_operationsnumberrequired -
uncommitted_sizestring -
uncommitted_size_in_bytesnumberrequired -
warmerWarmerStats -
Contains statistics about index warming operations for the node.
-
currentnumberrequired -
totalnumberrequired -
total_timestring Duration -
total_time_in_millisDurationValueUnitMillisrequired -
bulkBulkStats -
total_operationsnumberrequired -
total_timestring Duration -
total_time_in_millisDurationValueUnitMillisrequired -
total_sizenumber | string ByteSize -
total_size_in_bytesnumberrequired -
avg_timestring Duration -
avg_time_in_millisDurationValueUnitMillisrequired -
avg_sizenumber | string ByteSize -
avg_size_in_bytesnumberrequired -
shard_statsShardsTotalStats -
total_countnumberrequired -
shardsmap string to ShardStats -
totalIndexStats -
uuidstring -
healthHealthStatus -
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 -
statusIndexMetadataState -
Values:
openclose -
_shardsShardStatisticsrequired -
failednumber uintrequired -
The number of shards the operation or search attempted to run on but failed.
-
successfulnumber uintrequired -
The number of shards the operation or search succeeded on.
-
totalnumber uintrequired -
The number of shards the operation or search will run on overall.
-
failuresShardFailure -
indexstring IndexName -
nodestring -
reasonErrorCauserequired -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause -
shardnumber -
statusstring -
primaryboolean -
skippednumber uint -
_allIndicesStatsrequired -
primariesIndexStats -
completionCompletionStats -
Contains statistics about completions across all shards assigned to the node.
-
size_in_bytesnumberrequired -
Total amount, in bytes, of memory used for completion across all shards assigned to selected nodes.
-
sizenumber | string ByteSize -
Total amount of memory used for completion across all shards assigned to selected nodes.
-
fieldsmap string to FieldSizeUsage -
<string>FieldSizeUsage -
sizenumber | string ByteSize -
size_in_bytesnumberrequired -
docsDocStats -
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.
-
total_size_in_bytesnumberrequired -
Returns the total size in bytes of all documents in this stats. This value may be more reliable than store_stats.size_in_bytes in estimating the index size.
-
total_sizenumber | string ByteSize -
Human readable total_size_in_bytes
-
fielddataFielddataStats -
Contains statistics about the field data cache across all shards assigned to the node.
-
flushFlushStats -
Contains statistics about flush operations for the node.
-
periodicnumberrequired -
totalnumberrequired -
total_timestring Duration -
total_time_in_millisDurationValueUnitMillisrequired -
total_time_excluding_waitingstring Duration -
total_time_excluding_waiting_on_lock_in_millisDurationValueUnitMillisrequired -
getGetStats -
Contains statistics about get operations for the node.
-
indexingIndexingStats -
Contains statistics about indexing operations for the node.
-
indicesIndicesStats -
Contains statistics about indices operations for the node.
-
mergesMergesStats -
Contains statistics about merge operations for the node.
-
query_cacheQueryCacheStats -
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 ByteSize -
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.
-
miss_countnumberrequired -
Total count of query cache misses across all shards assigned to selected nodes.
-
total_countnumberrequired -
Total count of hits and misses in the query cache across all shards assigned to selected nodes.
-
recoveryRecoveryStats -
Contains statistics about recovery operations for the node.
-
current_as_sourcenumberrequired -
current_as_source_queuednumber -
current_as_targetnumberrequired -
current_as_target_queuednumber -
current_from_storenumber -
current_from_store_queuednumber -
throttle_timestring Duration -
throttle_time_in_millisDurationValueUnitMillisrequired -
refreshRefreshStats -
Contains statistics about refresh operations for the node.
-
external_totalnumberrequired -
external_total_timestring Duration -
external_total_time_in_millisDurationValueUnitMillisrequired -
listenersnumberrequired -
totalnumberrequired -
total_timestring Duration -
total_time_in_millisDurationValueUnitMillisrequired -
request_cacheRequestCacheStats -
Contains statistics about the request cache across all shards assigned to the node.
-
evictionsnumberrequired -
hit_countnumberrequired -
memory_sizestring -
memory_size_in_bytesnumberrequired -
miss_countnumberrequired -
searchSearchStats -
Contains statistics about search operations for the node.
-
segmentsSegmentsStats -
Contains statistics about segments across all shards assigned to the node.
-
storeStoreStats -
Contains statistics about the size of shards assigned to the node.
-
sizenumber | string ByteSize -
Total size of all shards assigned to selected nodes.
-
size_in_bytesnumberrequired -
Total size, in bytes, of all shards assigned to selected nodes.
-
reservednumber | string ByteSize -
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.
-
total_data_set_sizenumber | string ByteSize -
Total data set size of all shards assigned to selected nodes. This includes the size of shards not stored fully on the nodes, such as the cache for partially mounted indices.
-
total_data_set_size_in_bytesnumber -
Total data set size, in bytes, of all shards assigned to selected nodes. This includes the size of shards not stored fully on the nodes, such as the cache for partially mounted indices.
-
translogTranslogStats -
Contains statistics about transaction log operations for the node.
-
earliest_last_modified_agenumberrequired -
operationsnumberrequired -
sizestring -
size_in_bytesnumberrequired -
uncommitted_operationsnumberrequired -
uncommitted_sizestring -
uncommitted_size_in_bytesnumberrequired -
warmerWarmerStats -
Contains statistics about index warming operations for the node.
-
currentnumberrequired -
totalnumberrequired -
total_timestring Duration -
total_time_in_millisDurationValueUnitMillisrequired -
bulkBulkStats -
total_operationsnumberrequired -
total_timestring Duration -
total_time_in_millisDurationValueUnitMillisrequired -
total_sizenumber | string ByteSize -
total_size_in_bytesnumberrequired -
avg_timestring Duration -
avg_time_in_millisDurationValueUnitMillisrequired -
avg_sizenumber | string ByteSize -
avg_size_in_bytesnumberrequired -
shard_statsShardsTotalStats -
total_countnumberrequired -
shardsmap string to ShardStats -
totalIndexStats -
uuidstring -
healthHealthStatus -
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 -
statusIndexMetadataState -
Values:
openclose