You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _api-reference/cat/index.md
+122-4Lines changed: 122 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -24,17 +24,54 @@ GET _cat
24
24
```
25
25
{% include copy-curl.html %}
26
26
27
+
The response is an ASCII cat (`=^.^=`) and a list of operations:
28
+
29
+
```
30
+
=^.^=
31
+
/_cat/allocation
32
+
/_cat/segment_replication
33
+
/_cat/segment_replication/{index}
34
+
/_cat/shards
35
+
/_cat/shards/{index}
36
+
/_cat/cluster_manager
37
+
/_cat/nodes
38
+
/_cat/tasks
39
+
/_cat/indices
40
+
/_cat/indices/{index}
41
+
/_cat/segments
42
+
/_cat/segments/{index}
43
+
/_cat/count
44
+
/_cat/count/{index}
45
+
/_cat/recovery
46
+
/_cat/recovery/{index}
47
+
/_cat/health
48
+
/_cat/pending_tasks
49
+
/_cat/aliases
50
+
/_cat/aliases/{alias}
51
+
/_cat/thread_pool
52
+
/_cat/thread_pool/{thread_pools}
53
+
/_cat/plugins
54
+
/_cat/fielddata
55
+
/_cat/fielddata/{fields}
56
+
/_cat/nodeattrs
57
+
/_cat/repositories
58
+
/_cat/snapshots/{repository}
59
+
/_cat/templates
60
+
/_cat/pit_segments
61
+
/_cat/pit_segments/{pit_id}
62
+
```
63
+
27
64
## Optional query parameters
28
65
29
-
You can use the following query parameters with any CAT API to filter your results.
66
+
The root `_cat` API does not take any parameters, but individual APIs, such as `/_cat/nodes` accept the following query parameters.
30
67
31
68
Parameter | Description
32
69
:--- | :--- |
33
70
`v` | Provides verbose output by adding headers to the columns. It also adds some formatting to help align each of the columns together. All examples in this section include the `v` parameter.
34
71
`help` | Lists the default and other available headers for a given operation.
35
72
`h` | Limits the output to specific headers.
36
-
`format` | Returns the result in JSON, YAML, or CBOR formats.
37
-
`sort` | Sorts the output by the specified columns.
73
+
`format` | The format in which to return the result. Valid values are `json`, `yaml`, `cbor`, and `smile`.
To limit the output to a subset of headers, use the `h` parameter:
@@ -80,7 +134,71 @@ To limit the output to a subset of headers, use the `h` parameter:
80
134
GET _cat/<operation_name>?h=<header_name_1>,<header_name_2>&v
81
135
```
82
136
137
+
For example, to limit aliases to only the alias name and index, send the following request:
138
+
139
+
```json
140
+
GET _cat/aliases?h=alias,index
141
+
```
142
+
{% include copy-curl.html %}
143
+
144
+
The response contains the requested information:
145
+
146
+
```
147
+
.kibana .kibana_1
148
+
sample-alias1 sample-index-1
149
+
```
150
+
83
151
Typically, for any operation you can find out what headers are available using the `help` parameter, and then use the `h` parameter to limit the output to only the headers that you care about.
84
152
153
+
### Sort by a header
154
+
155
+
To sort the output by a header, use the `s` parameter:
156
+
157
+
```json
158
+
GET _cat/<operation_name>?s=<header_name_1>,<header_name_2>
159
+
```
160
+
161
+
For example, to sort aliases by alias and then index, send the following request:
162
+
163
+
```json
164
+
GET _cat/aliases?s=i,a
165
+
```
166
+
{% include copy-curl.html %}
167
+
168
+
The response contains the requested information:
169
+
170
+
```
171
+
sample-alias2 sample-index-1
172
+
sample-alias1 sample-index-2
173
+
```
174
+
175
+
### Retrieve data in JSON format
176
+
177
+
By default, CAT APIs return data in `text/plain` format.
178
+
179
+
To retrieve data in JSON format, use the `format=json` parameter:
180
+
181
+
```json
182
+
GET _cat/<operation_name>?format=json
183
+
```
184
+
185
+
For example, to retrieve aliases in JSON format, send the following request:
Other supported formats are [YAML](https://yaml.org/), [CBOR](https://cbor.io/), and [Smile](https://github.com/FasterXML/smile-format-specification).
202
+
85
203
If you use the Security plugin, make sure you have the appropriate permissions.
0 commit comments