---
type: api
title: Get node attribute information
description: Get information about custom node attributes.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/operation/operation-cat-nodeattrs
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/operation/operation-cat-nodeattrs
products:
  - Elasticsearch
---

# Get node attribute information

## Paths

- `GET` `/_cat/nodeattrs`

## Description

Get information about custom node attributes.
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.

## Required authorization

- Cluster privileges: `monitor`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/token-based-authentication-services)

## Query string parameters

- `h` (union oneOf) — optional
  A comma-separated list of columns names to display. It supports simple wildcards.

Supported values include:
  - `node`: The node name.
  - `id` (or `id`, `nodeId`): The unique node ID.
  - `pid` (or `p`): The process ID.
  - `host` (or `h`): The host name.
  - `ip` (or `i`): The IP address.
  - `port` (or `po`): The bound transport port.
  - `attr` (or `attr.name`): The attribute description.
  - `value` (or `attr.value`): The attribute value.
  Values: `node`, `id`, `nodeId`, `pid`, `p`, `host`, `h`, `ip`, `i`, `port`, `po`, `attr`, `attr.name`, `value`, `attr.value`
- `s` (union oneOf) — optional
  List of columns that determine how the table should be sorted.
Sorting defaults to ascending and can be changed by setting `:asc`
or `:desc` as a suffix to the column name.
  One of: `string[]` or `string`
- `local` (boolean · default: false) — optional
  If `true`, the request computes the list of selected nodes from the
local cluster state. If `false` the list of selected nodes are computed
from the cluster state of the master node. In both cases the coordinating
node will send requests for further information to each selected node.
- `master_timeout` (string · default: 30s) — optional
  Period to wait for a connection to the master node.
- `format` (string · default: text) — optional
  Specifies the format to return the columnar data in, can be set to
`text`, `json`, `cbor`, `yaml`, or `smile`.
- `help` (boolean · default: false) — optional
  When set to `true` will output available columns. This option
can't be combined with any other query string option.
- `v` (boolean · default: false) — optional
  When set to `true` will enable verbose output.
- `bytes` (enum) — optional
  Sets the units for columns that contain a byte-size value.
Note that byte-size value units work in terms of powers of 1024. For instance `1kb` means 1024 bytes, not 1000 bytes.
If omitted, byte-size values are rendered with a suffix such as `kb`, `mb`, or `gb`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`.
If given, byte-size values are rendered as an integer with no suffix, representing the value of the column in the chosen unit.
Values that are not an exact multiple of the chosen unit are rounded down.
  Values: `b`, `kb`, `mb`, `gb`, `tb`, `pb`
- `time` (enum) — optional
  Sets the units for columns that contain a time duration.
If omitted, time duration values are rendered with a suffix such as `ms`, `s`, `m` or `h`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`.
If given, time duration values are rendered as an integer with no suffix.
Values that are not an exact multiple of the chosen unit are rounded down.
  Values: `nanos`, `micros`, `ms`, `s`, `m`, `h`, `d`

## Response

`application/json`

Type: `object[]`

An array; each item has these fields:

- `node` (string)
  The node name.
- `id` (string)
  The unique node identifier.
- `pid` (string)
  The process identifier.
- `host` (string)
  The host name.
- `ip` (string)
  The IP address.
- `port` (string)
  The bound transport port.
- `attr` (string)
  The attribute name.
- `value` (string)
  The attribute value.
## Code examples

#### Console

```console
GET /_cat/nodeattrs?v=true&format=json
```

#### JavaScript

```javascript
const response = await client.cat.nodeattrs({
  v: "true",
  format: "json",
});
```

#### Python

```python
resp = client.cat.nodeattrs(
    v=True,
    format="json",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_cat/nodeattrs?v=true&format=json" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.cat().nodeattrs(n -> n);
```

#### PHP

```php
$resp = $client->cat()->nodeattrs([
    "v" => "true",
    "format" => "json",
]);
```

#### Ruby

```ruby
response = client.cat.nodeattrs(
  v: "true",
  format: "json"
)
```

## Response examples

#### Default columns

A successful response from `GET /_cat/nodeattrs?v=true&format=json`. The `node`, `host`, and `ip` columns provide basic information about each node. The `attr` and `value` columns return custom node attributes, one per line.

```json
[
  {
    "node": "node-0",
    "host": "127.0.0.1",
    "ip": "127.0.0.1",
    "attr": "testattr",
    "value": "test"
  }
]
```

#### Explicit columns

A successful response from `GET /_cat/nodeattrs?v=true&h=name,pid,attr,value`. It returns the `name`, `pid`, `attr`, and `value` columns.

```json
[
  {
    "name": "node-0",
    "pid": "19566",
    "attr": "testattr",
    "value": "test"
  }
]
```

