Get the cluster health status
- GET /_cluster/health/{index}
- GET /_cluster/health
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.
Required authorization
- Cluster privileges monitor manage
Query parameters
-
expand_wildcardsstring · default: all -
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 withopen,closed, orboth.none: Wildcard expressions are not accepted.
-
Values:
allopenclosedhiddennone -
level· 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_timeoutstring · 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.
-
timeoutstring · default: 30s -
Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
-
wait_for_active_shardsunion · 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_events -
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.
-
wait_for_no_initializing_shardsboolean · default: false -
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.
-
wait_for_no_relocating_shardsboolean · default: false -
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_status -
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(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
Response
-
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.
-
delayed_unassigned_shardsnumberrequired -
The number of shards whose allocation has been delayed by the timeout settings.
-
indicesmap string to object -
<string>object -
shardsmap string to object -
<string>object -
statusrequired -
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 -
statusrequired -
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 -
number_of_pending_tasksnumberrequired -
The number of cluster-level changes that have not yet been executed.
-
statusrequired -
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 -
task_max_waiting_in_queuestring -
The time since the earliest initiated task is waiting for being performed.
-
task_max_waiting_in_queue_millisnumberrequired -
The time expressed in milliseconds since the earliest initiated task is waiting for being performed.