# Elasticsearch Examples: Viewing Cluster, Node and Index State

Last updated:

## WIP ALERT This is a work in progress!

#### Using Sense

To avoid having to write CURL calls by hand to talk to Elasticsearch (except in calls to _cat), you can use Sense (Available as an unnoficial chrome add-on or as part of Marvel (free for development use)

For all examples, I've assumed the server is listening on localhoston port 9200. If this isn't the case for you, change it accordingly.

## Examples

$curl --silent 'http://localhost:9200/_cat/indices'| sed 's/\s\s*/ /g' | sort  ### Document count per index $ curl localhost:9200/_stats/docs?pretty=true


### What is the cluster health? Green, Yellow or Red?

health


### What is the overall cluster state?

stats


### What percentage of primary shards are actually assigned to nodes?

TODO: derived form stats


### What percentage of replica shards are actually assigned to nodes?

TODO


### What percentage of available RAM is being used in each node?

_nodes/stats


### What percentage of CPU is being used in each node?

_nodes/stats


### How many documents are being indexed per second?

TODO


### What's the current disk usage per node?

_nodes/stats


### How much memory is being used by the fielddata cache?

stats


### How much memory is being used for the filter cache?

stats


### How many documents are there in the whole cluster? In single index? In a single node?

_cluster/stats
_nodes/stats