Get index statistics

Auth

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 authorization

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 enum | enum[] optional

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 extra groups parameter (search operations can be associated with one or more groups). The groups parameter accepts a comma-separated list of group names. Use _all to 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 the include_segment_file_sizes parameter is true, 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: _all store indexing get search merge flush refresh query_cache fielddata docs warmer

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
<string> object
primaries object
completion object

Contains statistics about completions across all shards assigned to the node.

size_in_bytes number required

Total amount, in bytes, of memory used for completion across all shards assigned to selected nodes.

size number | string

Total amount of memory used for completion across all shards assigned to selected nodes.

fields map string to object
<string> object
size number | string
size_in_bytes number required
docs object

Contains statistics about documents across all primary shards assigned to the node.

count number required

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.

deleted number

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_bytes number required

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_size number | string

Human readable total_size_in_bytes

fielddata object

Contains statistics about the field data cache across all shards assigned to the node.

evictions number
memory_size number | string
memory_size_in_bytes number required
fields map string to object
<string> object
memory_size number | string
memory_size_in_bytes number required
global_ordinals object required
build_time_in_millis number required
build_time string
fields map string to object
<string> object
build_time_in_millis number required
build_time string
shard_max_value_count number required
flush object

Contains statistics about flush operations for the node.

periodic number required
total number required
total_time string
total_time_in_millis number required
total_time_excluding_waiting string
total_time_excluding_waiting_on_lock_in_millis number required
get object

Contains statistics about get operations for the node.

current number required
exists_time string
exists_time_in_millis number required
exists_total number required
missing_time string
missing_time_in_millis number required
missing_total number required
getTime string
time_in_millis number required
total number required
indexing object

Contains statistics about indexing operations for the node.

index_current number required
delete_current number required
delete_time string
delete_time_in_millis number required
delete_total number required
is_throttled boolean required
noop_update_total number required
throttle_time string
throttle_time_in_millis number required
index_time string
index_time_in_millis number required
index_total number required
index_failed number required
index_failed_due_to_version_conflict number required
types map string to object
write_load number
recent_write_load number
peak_write_load number
indices object

Contains statistics about indices operations for the node.

merges object

Contains statistics about merge operations for the node.

current number required
current_docs number required
current_size string
current_size_in_bytes number required
total number required
total_auto_throttle string
total_auto_throttle_in_bytes number required
total_docs number required
total_size string
total_size_in_bytes number required
total_stopped_time string
total_stopped_time_in_millis number required
total_throttled_time string
total_throttled_time_in_millis number required
total_time string
total_time_in_millis number required
query_cache object

Contains statistics about the query cache across all shards assigned to the node.

cache_count number required

Total number of entries added to the query cache across all shards assigned to selected nodes. This number includes current and evicted entries.

cache_size number required

Total number of entries currently in the query cache across all shards assigned to selected nodes.

evictions number required

Total number of query cache evictions across all shards assigned to selected nodes.

hit_count number required

Total count of query cache hits across all shards assigned to selected nodes.

memory_size number | string

Total amount of memory used for the query cache across all shards assigned to selected nodes.

memory_size_in_bytes number required

Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes.

miss_count number required

Total count of query cache misses across all shards assigned to selected nodes.

total_count number required

Total count of hits and misses in the query cache across all shards assigned to selected nodes.

recovery object

Contains statistics about recovery operations for the node.

current_as_source number required
current_as_source_queued number
current_as_target number required
current_as_target_queued number
current_from_store number
current_from_store_queued number
throttle_time string
throttle_time_in_millis number required
refresh object

Contains statistics about refresh operations for the node.

external_total number required
external_total_time string
external_total_time_in_millis number required
listeners number required
total number required
total_time string
total_time_in_millis number required
request_cache object

Contains statistics about the request cache across all shards assigned to the node.

evictions number required
hit_count number required
memory_size string
memory_size_in_bytes number required
miss_count number required

Contains statistics about search operations for the node.

fetch_current number required
fetch_time string
fetch_time_in_millis number required
fetch_total number required
fetch_failure number required
open_contexts number
query_current number required
query_time string
query_time_in_millis number required
query_total number required
query_failure number required
scroll_current number required
scroll_time string
scroll_time_in_millis number required
scroll_total number required
suggest_current number required
suggest_time string
suggest_time_in_millis number required
suggest_total number required
recent_search_load number
groups map string to object
segments object

Contains statistics about segments across all shards assigned to the node.

count number required

Total number of segments across all shards assigned to selected nodes.

doc_values_memory number | string

Total amount of memory used for doc values across all shards assigned to selected nodes.

doc_values_memory_in_bytes number required

Total amount, in bytes, of memory used for doc values across all shards assigned to selected nodes.

file_sizes map string to object required

This object is not populated by the cluster stats API. To get information on segment files, use the node stats API.

<string> object
description string required
size_in_bytes number required
min_size_in_bytes number
max_size_in_bytes number
average_size_in_bytes number
count number
fixed_bit_set number | 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_bytes number required

Total amount of memory, in bytes, used by fixed bit sets across all shards assigned to selected nodes.

index_writer_memory number | string

Total amount of memory used by all index writers across all shards assigned to selected nodes.

index_writer_memory_in_bytes number required

Total amount, in bytes, of memory used by all index writers across all shards assigned to selected nodes.

max_unsafe_auto_id_timestamp number required

Unix timestamp, in milliseconds, of the most recently retried indexing request.

memory number | string

Total amount of memory used for segments across all shards assigned to selected nodes.

memory_in_bytes number required

Total amount, in bytes, of memory used for segments across all shards assigned to selected nodes.

norms_memory number | string

Total amount of memory used for normalization factors across all shards assigned to selected nodes.

norms_memory_in_bytes number required

Total amount, in bytes, of memory used for normalization factors across all shards assigned to selected nodes.

points_memory number | string

Total amount of memory used for points across all shards assigned to selected nodes.

points_memory_in_bytes number required

Total amount, in bytes, of memory used for points across all shards assigned to selected nodes.

stored_fields_memory_in_bytes number required

Total amount, in bytes, of memory used for stored fields across all shards assigned to selected nodes.

stored_fields_memory number | string

Total amount of memory used for stored fields across all shards assigned to selected nodes.

terms_memory_in_bytes number required

Total amount, in bytes, of memory used for terms across all shards assigned to selected nodes.

terms_memory number | string

Total amount of memory used for terms across all shards assigned to selected nodes.

term_vectors_memory number | string

Total amount of memory used for term vectors across all shards assigned to selected nodes.

term_vectors_memory_in_bytes number required

Total amount, in bytes, of memory used for term vectors across all shards assigned to selected nodes.

version_map_memory number | string

Total amount of memory used by all version maps across all shards assigned to selected nodes.

version_map_memory_in_bytes number required

Total amount, in bytes, of memory used by all version maps across all shards assigned to selected nodes.

store object

Contains statistics about the size of shards assigned to the node.

size number | string

Total size of all shards assigned to selected nodes.

size_in_bytes number required

Total size, in bytes, of all shards assigned to selected nodes.

reserved number | 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_bytes number required

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_size number | string

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_bytes number

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.

translog object

Contains statistics about transaction log operations for the node.

earliest_last_modified_age number required
operations number required
size string
size_in_bytes number required
uncommitted_operations number required
uncommitted_size string
uncommitted_size_in_bytes number required
warmer object

Contains statistics about index warming operations for the node.

current number required
total number required
total_time string
total_time_in_millis number required
bulk object
total_operations number required
total_time string
total_time_in_millis number required
total_size number | string
total_size_in_bytes number required
avg_time string
avg_time_in_millis number required
avg_size number | string
avg_size_in_bytes number required
shard_stats object
total_count number required
shards map string to object
total object
Same fields as primaries in indices
uuid string
health enum

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
Values: open close
_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.

failures object[]
index string
node string
reason object required
type string required

The type of error

reason union string nullable

A human-readable explanation of the error, in English.

One of: string
stack_trace string

The server stack trace. Present only if the error_trace=true parameter was sent with the request.

caused_by object
Same fields as reason in failures
root_cause object[]
Same fields as reason in failures
suppressed object[]
Same fields as reason in failures
shard number
status string
primary boolean
skipped number
_all object required
primaries object
completion object

Contains statistics about completions across all shards assigned to the node.

size_in_bytes number required

Total amount, in bytes, of memory used for completion across all shards assigned to selected nodes.

size number | string

Total amount of memory used for completion across all shards assigned to selected nodes.

fields map string to object
<string> object
size number | string
size_in_bytes number required
docs object

Contains statistics about documents across all primary shards assigned to the node.

count number required

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.

deleted number

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_bytes number required

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_size number | string

Human readable total_size_in_bytes

fielddata object

Contains statistics about the field data cache across all shards assigned to the node.

Same fields as fielddata in primaries
flush object

Contains statistics about flush operations for the node.

periodic number required
total number required
total_time string
total_time_in_millis number required
total_time_excluding_waiting string
total_time_excluding_waiting_on_lock_in_millis number required
get object

Contains statistics about get operations for the node.

Same fields as get in primaries
indexing object

Contains statistics about indexing operations for the node.

Same fields as indexing in primaries
indices object

Contains statistics about indices operations for the node.

Same fields as _all
merges object

Contains statistics about merge operations for the node.

Same fields as merges in primaries
query_cache object

Contains statistics about the query cache across all shards assigned to the node.

cache_count number required

Total number of entries added to the query cache across all shards assigned to selected nodes. This number includes current and evicted entries.

cache_size number required

Total number of entries currently in the query cache across all shards assigned to selected nodes.

evictions number required

Total number of query cache evictions across all shards assigned to selected nodes.

hit_count number required

Total count of query cache hits across all shards assigned to selected nodes.

memory_size number | string

Total amount of memory used for the query cache across all shards assigned to selected nodes.

memory_size_in_bytes number required

Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes.

miss_count number required

Total count of query cache misses across all shards assigned to selected nodes.

total_count number required

Total count of hits and misses in the query cache across all shards assigned to selected nodes.

recovery object

Contains statistics about recovery operations for the node.

current_as_source number required
current_as_source_queued number
current_as_target number required
current_as_target_queued number
current_from_store number
current_from_store_queued number
throttle_time string
throttle_time_in_millis number required
refresh object

Contains statistics about refresh operations for the node.

external_total number required
external_total_time string
external_total_time_in_millis number required
listeners number required
total number required
total_time string
total_time_in_millis number required
request_cache object

Contains statistics about the request cache across all shards assigned to the node.

evictions number required
hit_count number required
memory_size string
memory_size_in_bytes number required
miss_count number required

Contains statistics about search operations for the node.

Same fields as search in primaries
segments object

Contains statistics about segments across all shards assigned to the node.

Same fields as segments in primaries
store object

Contains statistics about the size of shards assigned to the node.

size number | string

Total size of all shards assigned to selected nodes.

size_in_bytes number required

Total size, in bytes, of all shards assigned to selected nodes.

reserved number | 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_bytes number required

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_size number | string

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_bytes number

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.

translog object

Contains statistics about transaction log operations for the node.

earliest_last_modified_age number required
operations number required
size string
size_in_bytes number required
uncommitted_operations number required
uncommitted_size string
uncommitted_size_in_bytes number required
warmer object

Contains statistics about index warming operations for the node.

current number required
total number required
total_time string
total_time_in_millis number required
bulk object
total_operations number required
total_time string
total_time_in_millis number required
total_size number | string
total_size_in_bytes number required
avg_time string
avg_time_in_millis number required
avg_size number | string
avg_size_in_bytes number required
shard_stats object
total_count number required
shards map string to object
total object
Same fields as primaries in _all
uuid string
health enum

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
Values: open close