Get the cluster health status

  • GET /_cluster/health/{index}
  • GET /_cluster/health
Auth

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

Path parameters

index union string | string[] optional

A comma-separated list of data streams, indices, and index aliases that limit the request. Wildcard expressions (*) are supported. To target all data streams and indices in a cluster, omit this parameter or use _all or *.

Leave it out to use /_cluster/health.

Query parameters

expand_wildcards union oneOf · 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 with open, closed, or both.
  • none: Wildcard expressions are not accepted.
Values: all open closed hidden none
level enum · default: cluster

Return health information at a specific level of detail.

Values: cluster indices shards
local boolean · default: false

If true, retrieve information from the local node only. If false, retrieve information from the master node.

master_timeout string · 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.

timeout string · 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_shards union oneOf · default: 0

Wait for the specified number of active shards. Use all to wait for all shards in the cluster to be active. Use 0 to not wait.

Values: all index-setting
wait_for_events enum

Wait until all currently queued events with the given priority are processed.

Values: immediate urgent high normal low languid
wait_for_nodes number | string

Wait until the specified number (N) of nodes is available. It also accepts >=N, <=N, >N and <N. Alternatively, use the notations ge(N), le(N), gt(N), and lt(N).

wait_for_no_initializing_shards boolean · 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_shards boolean · 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 enum

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 (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

Responses

application/json
active_primary_shards number required

The number of active primary shards.

active_shards number required

The total number of active primary and replica shards.

active_shards_percent string

The ratio of active shards in the cluster expressed as a string formatted percentage.

active_shards_percent_as_number number required

The ratio of active shards in the cluster expressed as a percentage.

cluster_name string required

The name of the cluster.

delayed_unassigned_shards number required

The number of shards whose allocation has been delayed by the timeout settings.

indices map string to object
<string> object
active_primary_shards number required
active_shards number required
initializing_shards number required
number_of_replicas number required
number_of_shards number required
relocating_shards number required
shards map string to object
<string> object
active_shards number required
initializing_shards number required
primary_active boolean required
relocating_shards number required
status enum required

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
unassigned_shards number required
unassigned_primary_shards number required
status enum required

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
unassigned_shards number required
unassigned_primary_shards number required
initializing_shards number required

The number of shards that are under initialization.

number_of_data_nodes number required

The number of nodes that are dedicated data nodes.

number_of_in_flight_fetch number required

The number of unfinished fetches.

number_of_nodes number required

The number of nodes within the cluster.

number_of_pending_tasks number required

The number of cluster-level changes that have not yet been executed.

relocating_shards number required

The number of shards that are under relocation.

status enum required

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
task_max_waiting_in_queue string

The time since the earliest initiated task is waiting for being performed.

task_max_waiting_in_queue_millis number required

The time expressed in milliseconds since the earliest initiated task is waiting for being performed.

timed_out boolean required

If false the response returned within the period of time that is specified by the timeout parameter (30s by default)

unassigned_primary_shards number required

The number of primary shards that are not allocated.

unassigned_shards number required

The number of shards that are not allocated.

application/json
active_primary_shards number required

The number of active primary shards.

active_shards number required

The total number of active primary and replica shards.

active_shards_percent string

The ratio of active shards in the cluster expressed as a string formatted percentage.

active_shards_percent_as_number number required

The ratio of active shards in the cluster expressed as a percentage.

cluster_name string required

The name of the cluster.

delayed_unassigned_shards number required

The number of shards whose allocation has been delayed by the timeout settings.

indices map string to object
<string> object
active_primary_shards number required
active_shards number required
initializing_shards number required
number_of_replicas number required
number_of_shards number required
relocating_shards number required
shards map string to object
<string> object
active_shards number required
initializing_shards number required
primary_active boolean required
relocating_shards number required
status enum required

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
unassigned_shards number required
unassigned_primary_shards number required
status enum required

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
unassigned_shards number required
unassigned_primary_shards number required
initializing_shards number required

The number of shards that are under initialization.

number_of_data_nodes number required

The number of nodes that are dedicated data nodes.

number_of_in_flight_fetch number required

The number of unfinished fetches.

number_of_nodes number required

The number of nodes within the cluster.

number_of_pending_tasks number required

The number of cluster-level changes that have not yet been executed.

relocating_shards number required

The number of shards that are under relocation.

status enum required

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
task_max_waiting_in_queue string

The time since the earliest initiated task is waiting for being performed.

task_max_waiting_in_queue_millis number required

The time expressed in milliseconds since the earliest initiated task is waiting for being performed.

timed_out boolean required

If false the response returned within the period of time that is specified by the timeout parameter (30s by default)

unassigned_primary_shards number required

The number of primary shards that are not allocated.

unassigned_shards number required

The number of shards that are not allocated.