Search + K

Command Palette

Search for a command to run...

Sign In

Get the cluster health status

GET /_cluster/health/{index}
Copy endpoint

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

Parameters

path Path Parameters

Name Type
index required

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 *.

type TypesIndices = type TypesIndexName = string | type TypesIndexName = string[]

query Query Parameters

Name Type
expand_wildcards

Expand wildcard expression to concrete indices that are open, closed or both.

type TypesExpandWildcards = type TypesExpandWildcard = "all" | "open" | "closed" | "hidden" | "none" | type TypesExpandWildcard = "all" | "open" | "closed" | "hidden" | "none"[]
level

Return health information at a specific level of detail.

type TypesLevel = "cluster" | "indices" | "shards"
local

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

boolean
master_timeout

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.

type TypesDuration = string | "-1" | "0"
timeout

The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

type TypesDuration = string | "-1" | "0"
wait_for_active_shards

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.

type TypesWaitForActiveShards = type TypesWaitForActiveShardOptions = "all" | "index-setting" | number
wait_for_events

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

type TypesWaitForEvents = "immediate" | "urgent" | "high" | "normal" | "low" | "languid"
wait_for_nodes

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).

type ClusterHealthWaitForNodes = string | number
wait_for_no_initializing_shards

Wait (until the timeout expires) for the cluster to have no shard initializations. If false, the request does not wait for initializing shards.

boolean
wait_for_no_relocating_shards

Wait (until the timeout expires) for the cluster to have no shard relocations. If false, the request not wait for relocating shards.

boolean
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.

type TypesHealthStatus = "green" | "GREEN" | "yellow" | "YELLOW" | "red" | "RED" | "unknown" | "unavailable"

Responses

200 application/json
interface ClusterHealthHealthResponseBody {
active_primary_shards: number;
active_shards: number;
active_shards_percent?: string;
active_shards_percent_as_number: number;
cluster_name: TypesName
type TypesName = string
;
delayed_unassigned_shards: number;
indices?: { };
initializing_shards: number;
number_of_data_nodes: number;
number_of_in_flight_fetch: number;
number_of_nodes: number;
number_of_pending_tasks: number;
relocating_shards: number;
status: TypesHealthStatus
type TypesHealthStatus = "green" | "GREEN" | "yellow" | "YELLOW" | "red" | "RED" | "unknown" | "unavailable"
;
task_max_waiting_in_queue?: TypesDuration

A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

type TypesDuration = string | "-1" | "0"
;
task_max_waiting_in_queue_millis: TypesDurationValueUnitMillis
type TypesDurationValueUnitMillis = TypesUnitMillis
;
timed_out: boolean;
unassigned_primary_shards: number;
unassigned_shards: number;
}