# Api to print clustername with heap percentage

**URL:** <https://discuss.elastic.co/t/api-to-print-clustername-with-heap-percentage/155709>\
**Category:** Elasticsearch\
**Created:** [November 7, 2018, 12:20pm UTC](https://discuss.elastic.co/t/api-to-print-clustername-with-heap-percentage/155709 "2018-11-07T12:20:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![batman](https://avatars.discourse-cdn.com/v4/letter/b/9fc29f/32.png) [@batman](https://discuss.elastic.co/u/batman)\
**Post date:** [November 7, 2018, 12:20pm UTC](https://discuss.elastic.co/t/api-to-print-clustername-with-heap-percentage/155709/1 "2018-11-07T12:20:24Z")

</div>

Hi All,

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

Any insight will be helpful.

Thanks

---

<div class="post-metadata">

**Author:** ![mats990](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mats990/32/37516_2.png) [@mats990](https://discuss.elastic.co/u/mats990)\
**Post date:** [November 7, 2018, 12:43pm UTC](https://discuss.elastic.co/t/api-to-print-clustername-with-heap-percentage/155709/2 "2018-11-07T12:43:50Z")

</div>

You can find all the information you need here: [Nodes stats API | Elasticsearch Guide [8.11] | Elastic](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](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](http://localhost:9200/_nodes/stats)" | jq '.nodes | {hostname:.name, heapPercent:.jvm.mem.heap\_used\_percent}'

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 5, 2018, 12:43pm UTC](https://discuss.elastic.co/t/api-to-print-clustername-with-heap-percentage/155709/3 "2018-12-05T12:43:52Z")

</div>

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