Get the cluster health status
Generally available
IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console.
They are not intended for use by applications. For application consumption, use the cluster health API.
This API is often used to check malfunctioning clusters.
To help you track cluster health alongside log files and alerting systems, the API returns timestamps in two formats:
HH:MM:SS
, which is human-readable but includes no date information;
Unix epoch time
, which is machine-sortable and includes date information.
The latter format is useful for cluster recoveries that take multiple days.
You can use the cat health API to verify cluster health across multiple nodes.
You also can use the API to track the recovery of a large cluster over a longer period of time.
Required authorization
- Cluster privileges:
monitor
Query parameters
-
The unit used to display time values.
Values are
nanos
,micros
,ms
,s
,m
,h
, ord
. -
If true, returns
HH:MM:SS
and Unix epoch timestamps. -
A comma-separated list of columns names to display. It supports simple wildcards.
Supported values include:
epoch
(ort
,time
): The number of seconds since 1970-01-01 00:00:00.timestamp
(orts
,hms
,hhmmss
): The time in HH:MM:SS format.cluster
(orcl
): The cluster name.status
(orst
): The health status.node.total
(ornt
,nodeTotal
): The total number of nodes that can store data.node.data
(ornd
,nodeData
): The number of nodes that can store data.shards
(ort
,sh
,shards.total
,shardsTotal
): The total number of shards.pri
(orp
,shards.primary
,shardsPrimary
): The number of primary shards.relo
(orr
,shards.relocating
,shardsRelocating
): The number of relocating nodes.init
(ori
,shards.initializing
,shardsInitializing
): The number of initializing nodes.unassign
(oru
,shards.unassigned
,shardsUnassigned
): The number of unassigned shards.unassign.pri
(orup
,shards.unassigned.primary
,shardsUnassignedPrimary
): The number of unassigned primary shards.pending_tasks
(orpt
,pendingTasks
): The number of pending tasks.max_task_wait_time
(ormtwt
,maxTaskWaitTime
): The wait time of the longest pending task.active_shards_percent
(orasp
,activeShardsPercent
): The percentage of active shards.
Values are
epoch
,t
,time
,timestamp
,ts
,hms
,hhmmss
,cluster
,cl
,status
,st
,node.total
,nt
,nodeTotal
,node.data
,nd
,nodeData
,shards
,sh
,shards.total
,shardsTotal
,pri
,p
,shards.primary
,shardsPrimary
,relo
,r
,shards.relocating
,shardsRelocating
,init
,i
,shards.initializing
,shardsInitializing
,unassign
,u
,shards.unassigned
,shardsUnassigned
,unassign.pri
,up
,shards.unassigned.primary
,shardsUnassignedPrimary
,pending_tasks
,pt
,pendingTasks
,max_task_wait_time
,mtwt
,maxTaskWaitTime
,active_shards_percent
,asp
, oractiveShardsPercent
. -
List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting
:asc
or:desc
as a suffix to the column name.
GET /_cat/health?v=true&format=json
resp = client.cat.health(
v=True,
format="json",
)
const response = await client.cat.health({
v: "true",
format: "json",
});
response = client.cat.health(
v: "true",
format: "json"
)
$resp = $client->cat()->health([
"v" => "true",
"format" => "json",
]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/health?v=true&format=json"
client.cat().health();
[
{
"epoch": "1475871424",
"timestamp": "16:17:04",
"cluster": "elasticsearch",
"status": "green",
"node.total": "1",
"node.data": "1",
"shards": "1",
"pri": "1",
"relo": "0",
"init": "0",
"unassign": "0",
"unassign.pri": "0",
"pending_tasks": "0",
"max_task_wait_time": "-",
"active_shards_percent": "100.0%"
}
]