Monitor ElasticSearch cluster health - Useful for keeping an eye on ES when rebalancing takes place

while true; do clear; curl -XGET 'http://localhost:9200/_cluster/health?pretty=true'; sleep 1; done
Sample Output
  "cluster_name" : "es-cluster",
  "status" : "yellow",
  "timed_out" : false,
  "number_of_nodes" : 3,
  "number_of_data_nodes" : 3,
  "active_primary_shards" : 6145,
  "active_shards" : 11485,
  "relocating_shards" : 0,
  "initializing_shards" : 2,
  "unassigned_shards" : 803,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 14431,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 25721,
  "active_shards_percent_as_number" : 93.44995931651749

By: cosmin
2016-05-25 16:21:35

1 Alternatives + Submit Alt

What Others Think

even better, make sounds when cluster healed, just in case you're somewhere else while true; do curl -XGET http://localhost:9200/_cluster/health?pretty | grep -q 'green' && echo -e '\a'; sleep 1s; done
thepiano · 147 weeks and 6 days ago
These cluster health searches work like a charm, and if anyone who is looking for where to buy cbd oil washington dc tells you that these products don't work, then they're wrong. Anyone who has any idea will know that these actually work.
WalkerNolan · 62 weeks and 5 days ago
great that i found this forum. People here are great. Learned alot. Keep posting more
Killersmile · 12 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: