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 -
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 -
Return health information at a specific level of detail.
-
Values:
clusterindicesshards -
localboolean · default: false -
If true, retrieve information from the local node only. If false, retrieve information from the master node.
-
master_timeoutstring · default: 30s -
The 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 -
The 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 -
Wait for the specified number of active shards. Use
allto wait for all shards in the cluster to be active. Use0to not wait. -
Values:
allindex-setting -
wait_for_events -
Wait until all currently queued events with the given priority are processed.
-
Values:
immediateurgenthighnormallowlanguid -
wait_for_nodesnumber | string -
Wait until the specified number (N) of nodes is available. It also accepts
>=N,<=N,>Nand<N. Alternatively, use the notationsge(N),le(N),gt(N), andlt(N). -
wait_for_no_initializing_shardsboolean · default: false -
Wait (until the timeout expires) for the cluster to have no shard initializations. If false, the request does not wait for initializing shards.
-
wait_for_no_relocating_shardsboolean · default: false -
Wait (until the timeout expires) for the cluster to have no shard relocations. If false, the request not wait for relocating shards.
-
wait_for_status -
Wait (until the timeout expires) for the cluster to reach a specific health status (or a better status). A green status is better than yellow and yellow is better than red. By default, the request does not wait for a particular 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
Responses
-
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.
-
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.