Returning a List of Nodes via an Attribute

Howdy, everyone! I've spent a while searching through the API endpoint documentation, but I haven't really gotten anywhere, so figured I'd ask the experts.

Basically, I'm trying to programmatically get a list of all nodes configured in our hot cluster. I can parse this out of "/_nodes/settings" since "attributes" contains "box_type" but this is a bit clunky due to the sheer size of the JSON response. Seems like searching for nodes via an attribute presence or value is likely something someone else has wanted to do before, so thought I'd check here before I spend more time hacking together my own solution.

Thanks in advance!

I think the page you're looking for is this one:

https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html

You can describe nodes with the string attribute:value, e.g. box_type:hot, in various APIs. So for instance

GET /_nodes/box_type:hot/process

will get you a small amount of information about the hot nodes.

That’s perfect! Thank you so much!

1 Like

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