Skip to content

elasticsearch get-cluster-health

Get elastic search cluster health


Get the health status of a cluster


elasticsearch get-cluster-health
    [--site <site>]
    [--cluster <cluster>]
    [--filter_path <filter_path>]
    [--target <target>]
    [--level <level>]


site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default:      Attributes: optional

cluster - (string)

     Name of elastic search cluster
     Example: --cluster "elastic-default"
     Default: elastic-default      Attributes: optional

filter_path - (string)

     Path in the response. Filters and returns only parts of response matching this path
     Example: --filter_path "*"
     Default: _None_      Attributes: optional, multiple allowed

raw - (bool)

     If false, returns compact and aligned text output
     Example: --raw
     Default: _None_      Attributes: optional

target - (string)

     List of data streams, indices, and index aliases used to limit the request
     Example: --target "students or _all"
     Default: _all      Attributes: optional, multiple allowed

level - (string)

     Can be either cluster/indices/shards. Controls the details level of the health information returned
     Example: --level "cluster"
     Default: cluster      Attributes: optional

local - (bool)

     If set, the request retrieves information from the local node only. By default information is retrieved from the master node.
     Example: --local
     Default: _None_      Attributes: optional



! elasticsearch get-cluster-health --cluster "elastic-1" --target "class" --target "test" --level "cluster" --local --raw
  "cluster_name": "default",
  "status": "yellow",
  "timed_out": false,
  "number_of_nodes": 1,
  "number_of_data_nodes": 1,
  "active_primary_shards": 3,
  "active_shards": 3,
  "relocating_shards": 0,
  "initializing_shards": 0,
  "unassigned_shards": 3,
  "delayed_unassigned_shards": 0,
  "number_of_pending_tasks": 0,
  "number_of_in_flight_fetch": 0,
  "task_max_waiting_in_queue_millis": 0,
  "active_shards_percent_as_number": 14.634146341463413
! elasticsearch get-cluster-health
    "epoch": "1639500455",
    "timestamp": "16:47:35",
    "cluster": "default",
    "status": "red",
    "": "1",
    "": "1",
    "shards": "20",
    "pri": "20",
    "relo": "0",
    "init": "0",
    "unassign": "81",
    "pending_tasks": "0",
    "max_task_wait_time": "-",
    "active_shards_percent": "19.8%"

Access Control

To use this command, you need access to the following:

Field Value
Action "read"
Service Type "elasticsearch"
Service Instance cluster
Object Type "cluster"
Object ID

Please see Access Control for details.