nodeattrs.asciidoc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. [[cat-nodeattrs]]
  2. == cat nodeattrs
  3. The `nodeattrs` command shows custom node attributes.
  4. For example:
  5. [source,js]
  6. --------------------------------------------------
  7. GET /_cat/nodeattrs?v
  8. --------------------------------------------------
  9. // CONSOLE
  10. // TEST[s/\?v/\?v&s=node,attr/]
  11. // Sort the resulting attributes so we can assert on them more easilly
  12. Could look like:
  13. [source,txt]
  14. --------------------------------------------------
  15. node host ip attr value
  16. ...
  17. node-0 127.0.0.1 127.0.0.1 testattr test
  18. ...
  19. --------------------------------------------------
  20. // TESTRESPONSE[s/\.\.\.\n$/\n(.+ xpack\\.installed true\n)?\n/]
  21. // TESTRESPONSE[s/\.\.\.\n/(.+ ml\\..+\n)*/ _cat]
  22. // If xpack is not installed then neither ... with match anything
  23. // If xpack is installed then the first ... contains ml attributes
  24. // and the second contains xpack.installed=true
  25. The first few columns (`node`, `host`, `ip`) give you basic info per node
  26. and the `attr` and `value` columns give you the custom node attributes,
  27. one per line.
  28. [float]
  29. === Columns
  30. Below is an exhaustive list of the existing headers that can be
  31. passed to `nodeattrs?h=` to retrieve the relevant details in ordered
  32. columns. If no headers are specified, then those marked to Appear
  33. by Default will appear. If any header is specified, then the defaults
  34. are not used.
  35. Aliases can be used in place of the full header name for brevity.
  36. Columns appear in the order that they are listed below unless a
  37. different order is specified (e.g., `h=attr,value` versus `h=value,attr`).
  38. When specifying headers, the headers are not placed in the output
  39. by default. To have the headers appear in the output, use verbose
  40. mode (`v`). The header name will match the supplied value (e.g.,
  41. `pid` versus `p`). For example:
  42. [source,js]
  43. --------------------------------------------------
  44. GET /_cat/nodeattrs?v&h=name,pid,attr,value
  45. --------------------------------------------------
  46. // CONSOLE
  47. // TEST[s/,value/,value&s=node,attr/]
  48. // Sort the resulting attributes so we can assert on them more easilly
  49. Might look like:
  50. [source,txt]
  51. --------------------------------------------------
  52. name pid attr value
  53. ...
  54. node-0 19566 testattr test
  55. ...
  56. --------------------------------------------------
  57. // TESTRESPONSE[s/19566/\\d*/]
  58. // TESTRESPONSE[s/\.\.\.\n$/\n(.+ xpack\\.installed true\n)?\n/]
  59. // TESTRESPONSE[s/\.\.\.\n/(.+ ml\\..+\n)*/ _cat]
  60. // If xpack is not installed then neither ... with match anything
  61. // If xpack is installed then the first ... contains ml attributes
  62. // and the second contains xpack.installed=true
  63. [cols="<,<,<,<,<",options="header",subs="normal"]
  64. |=======================================================================
  65. |Header |Alias |Appear by Default |Description |Example
  66. |`node`|`name`|Yes|Name of the node|DKDM97B
  67. |`id` |`nodeId` |No |Unique node ID |k0zy
  68. |`pid` |`p` |No |Process ID |13061
  69. |`host` |`h` |Yes |Host name |n1
  70. |`ip` |`i` |Yes |IP address |127.0.1.1
  71. |`port` |`po` |No |Bound transport port |9300
  72. |`attr` | `attr.name` | Yes | Attribute name | rack
  73. |`value` | `attr.value` | Yes | Attribute value | rack123
  74. |=======================================================================