| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 | [[cluster]]== Cluster APIs["float",id="cluster-nodes"]=== Node specificationSome cluster-level APIs may operate on a subset of the nodes which can bespecified with _node filters_. For example, the <<tasks,Task Management>>,<<cluster-nodes-stats,Nodes Stats>>, and <<cluster-nodes-info,Nodes Info>> APIscan all report results from a filtered set of nodes rather than from all nodes._Node filters_ are written as a comma-separated list of individual filters,each of which adds or removes nodes from the chosen subset. Each filter can beone of the following:* `_all`, to add all nodes to the subset.* `_local`, to add the local node to the subset.* `_master`, to add the currently-elected master node to the subset.* a node id or name, to add this node to the subset.* an IP address or hostname, to add all matching nodes to the subset.* a pattern, using `*` wildcards, which adds all nodes to the subset  whose name, address or hostname matches the pattern.* `master:true`, `data:true`, `ingest:true`, `voting_only:true`, `ml:true`, or  `coordinating_only:true`, which respectively add to the subset all  master-eligible nodes, all data nodes, all ingest nodes, all voting-only  nodes, all machine learning nodes, and all coordinating-only nodes.* `master:false`, `data:false`, `ingest:false`, `voting_only:true`, `ml:false`,  or `coordinating_only:false`, which respectively remove from the subset all  master-eligible nodes, all data nodes, all ingest nodes, all voting-only  nodes, all machine learning nodes, and all coordinating-only nodes.* a pair of patterns, using `*` wildcards, of the form `attrname:attrvalue`,  which adds to the subset all nodes with a custom node attribute whose name  and value match the respective patterns. Custom node attributes are  configured by setting properties in the configuration file of the form  `node.attr.attrname: attrvalue`.NOTE: node filters run in the order in which they are given, which is importantif using filters that remove nodes from the set. For example`_all,master:false` means all the nodes except the master-eligible ones, but`master:false,_all` means the same as `_all` because the `_all` filter runsafter the `master:false` filter.NOTE: if no filters are given, the default is to select all nodes. However, ifany filters are given then they run starting with an empty chosen subset. Thismeans that filters such as `master:false` which remove nodes from the chosensubset are only useful if they come after some other filters. When used on itsown, `master:false` selects no nodes.Here are some examples of the use of node filters with the<<cluster-nodes-info,Nodes Info>> APIs.[source,console]--------------------------------------------------# If no filters are given, the default is to select all nodesGET /_nodes# Explicitly select all nodesGET /_nodes/_all# Select just the local nodeGET /_nodes/_local# Select the elected master nodeGET /_nodes/_master# Select nodes by name, which can include wildcardsGET /_nodes/node_name_goes_hereGET /_nodes/node_name_goes_*# Select nodes by address, which can include wildcardsGET /_nodes/10.0.0.3,10.0.0.4GET /_nodes/10.0.0.*# Select nodes by roleGET /_nodes/_all,master:falseGET /_nodes/data:true,ingest:trueGET /_nodes/coordinating_only:trueGET /_nodes/master:true,voting_only:false# Select nodes by custom attribute (e.g. with something like `node.attr.rack: 2` in the configuration file)GET /_nodes/rack:2GET /_nodes/ra*:2GET /_nodes/ra*:2*--------------------------------------------------include::cluster/allocation-explain.asciidoc[]include::cluster/get-settings.asciidoc[]include::cluster/health.asciidoc[]include::cluster/reroute.asciidoc[]include::cluster/state.asciidoc[]include::cluster/stats.asciidoc[]include::cluster/update-settings.asciidoc[]include::cluster/nodes-usage.asciidoc[]include::cluster/nodes-hot-threads.asciidoc[]include::cluster/nodes-info.asciidoc[]include::cluster/nodes-reload-secure-settings.asciidoc[]include::cluster/nodes-stats.asciidoc[]include::cluster/pending.asciidoc[]include::cluster/remote-info.asciidoc[]include::cluster/tasks.asciidoc[]include::cluster/voting-exclusions.asciidoc[]include::cluster/update-desired-nodes.asciidoc[]include::cluster/get-desired-nodes.asciidoc[]include::cluster/delete-desired-nodes.asciidoc[]
 |