Elasticsearch Cluster Human readable, tabular Cluster Health with selected headers

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Example uses basic HTTP syntax. Any <#> in the example should be removed when copying it.

Like most _cat APIs in Elasticsearch, the API selectively responds with a default set of fields. However, other fields exist from the API if you want them:

GET /_cat/health?help <1>
  1. ?help causes the API to return the fields (and short names) as well as a brief description.

_cat/health has existed since Elasticsearch 1.x, but here is an example of its output from Elasticsearch 5.x:

Fields available as-of this example's creation date:

epoch                 | t,time                                   | seconds since 1970-01-01 00:00:00  
timestamp             | ts,hms,hhmmss                            | time in HH:MM:SS                   
cluster               | cl                                       | cluster name                       
status                | st                                       | health status                      
node.total            | nt,nodeTotal                             | total number of nodes              
node.data             | nd,nodeData                              | number of nodes that can store data
shards                | t,sh,shards.total,shardsTotal            | total number of shards             
pri                   | p,shards.primary,shardsPrimary           | number of primary shards           
relo                  | r,shards.relocating,shardsRelocating     | number of relocating nodes         
init                  | i,shards.initializing,shardsInitializing | number of initializing nodes       
unassign              | u,shards.unassigned,shardsUnassigned     | number of unassigned shards        
pending_tasks         | pt,pendingTasks                          | number of pending tasks            
max_task_wait_time    | mtwt,maxTaskWaitTime                     | wait time of longest task pending  
active_shards_percent | asp,activeShardsPercent                  | active number of shards in percent 

You can then use this to print only those fields:

GET /_cat/health?h=timestamp,cl,status&v <1>
  1. h=... defines the list of fields that you want returned.
  2. v (verbose) defines that you want it to print the headers.

The output from an instance of Elasticsearch 5.x:

timestamp cl            status
15:38:00  elasticsearch yellow


Got any Elasticsearch Question?