Api to print clustername with heap percentage

(Karthick) #1

Hi All,

Is there any api to print elastic search node heap percentage along with cluster name?

Any insight will be helpful.


(Matija Bruncic) #2

You can find all the information you need here: https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html

If you want to execute this API from terminal you can use this snippet to get only the information you need:

curl -XGET "http://localhost:9200/_nodes/stats" | jq '.nodes | {hostname:.name, OSMemoryUsage:(.os.mem.used_in_bytes/.os.mem.total_in_bytes)} '

curl -XGET "http://localhost:9200/_nodes/stats" | jq '.nodes | {hostname:.name, heapPercent:.jvm.mem.heap_used_percent}'

(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.