AuthThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.AvailabilityGenerally available since 1.3This 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.
You can also use the API to get the health status of only specified data streams and indices.
For data streams, the API retrieves the health status of the stream’s backing indices.
The cluster health status is: green, yellow or red.
On the shard level, a red status indicates that the specific shard is not allocated in the cluster. Yellow means that the primary shard is allocated but replicas are not. Green means that all shards are allocated.
The index level status is controlled by the worst shard status.
One of the main benefits of the API is the ability to wait until the cluster reaches a certain high watermark health level.
The cluster status is controlled by the worst index status.
Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target all data streams and indices in a cluster, omit this parameter or use _all or *.
Whether to expand wildcard expression to concrete indices that are open, closed or both.
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:allopenclosedhiddennone
levelenum · default: cluster
Can be one of cluster, indices or shards. Controls the details level of the health information returned.
Values:clusterindicesshards
localboolean · default: false
If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.
master_timeoutuniononeOf · default: 30s
Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
Values:-10
timeoutuniononeOf · default: 30s
Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
Values:-10
wait_for_active_shardsuniononeOf · default: 0
A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait.
Values:allindex-setting
wait_for_eventsenum
Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed.
Values:immediateurgenthighnormallowlanguid
wait_for_nodesnumber | string
The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and <N. Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N) notation.
A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards.
A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards.
wait_for_statusenum
One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status.
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.
The total number of active primary and replica shards.
active_shards_percentstring
The ratio of active shards in the cluster expressed as a string formatted percentage.
active_shards_percent_as_numbernumberrequired
The ratio of active shards in the cluster expressed as a percentage.
cluster_namestringrequired
The name of the cluster.
delayed_unassigned_shardsnumberrequired
The number of shards whose allocation has been delayed by the timeout settings.
indicesmapstring to object
<string>object
active_primary_shardsnumberrequired
active_shardsnumberrequired
initializing_shardsnumberrequired
number_of_replicasnumberrequired
number_of_shardsnumberrequired
relocating_shardsnumberrequired
shardsmapstring to object
<string>object
active_shardsnumberrequired
initializing_shardsnumberrequired
primary_activebooleanrequired
relocating_shardsnumberrequired
statusenumrequired
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.
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.
The number of shards that are under initialization.
number_of_data_nodesnumberrequired
The number of nodes that are dedicated data nodes.
number_of_in_flight_fetchnumberrequired
The number of unfinished fetches.
number_of_nodesnumberrequired
The number of nodes within the cluster.
number_of_pending_tasksnumberrequired
The number of cluster-level changes that have not yet been executed.
relocating_shardsnumberrequired
The number of shards that are under relocation.
statusenumrequired
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.
The time since the earliest initiated task is waiting for being performed.
Values:-10
task_max_waiting_in_queue_millisnumberrequired
The time expressed in milliseconds since the earliest initiated task is waiting for being performed.
timed_outbooleanrequired
If false the response returned within the period of time that is specified by the timeout parameter (30s by default)
unassigned_primary_shardsnumberrequired
The number of primary shards that are not allocated.
unassigned_shardsnumberrequired
The number of shards that are not allocated.
application/json
active_primary_shardsnumberrequired
The number of active primary shards.
active_shardsnumberrequired
The total number of active primary and replica shards.
active_shards_percentstring
The ratio of active shards in the cluster expressed as a string formatted percentage.
active_shards_percent_as_numbernumberrequired
The ratio of active shards in the cluster expressed as a percentage.
cluster_namestringrequired
The name of the cluster.
delayed_unassigned_shardsnumberrequired
The number of shards whose allocation has been delayed by the timeout settings.
indicesmapstring to object
<string>object
active_primary_shardsnumberrequired
active_shardsnumberrequired
initializing_shardsnumberrequired
number_of_replicasnumberrequired
number_of_shardsnumberrequired
relocating_shardsnumberrequired
shardsmapstring to object
<string>object
active_shardsnumberrequired
initializing_shardsnumberrequired
primary_activebooleanrequired
relocating_shardsnumberrequired
statusenumrequired
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.
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.
The number of shards that are under initialization.
number_of_data_nodesnumberrequired
The number of nodes that are dedicated data nodes.
number_of_in_flight_fetchnumberrequired
The number of unfinished fetches.
number_of_nodesnumberrequired
The number of nodes within the cluster.
number_of_pending_tasksnumberrequired
The number of cluster-level changes that have not yet been executed.
relocating_shardsnumberrequired
The number of shards that are under relocation.
statusenumrequired
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.