All methods and paths for this operation:
Get the cluster's index aliases, including filter and routing information. This API does not return data stream aliases.
IMPORTANT: CAT APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API.
Required authorization
- Index privileges:
view_index_metadata
Path parameters
-
A comma-separated list of aliases to retrieve. Supports wildcards (
*). To retrieve all aliases, omit this parameter or use*or_all.
Query parameters
-
A comma-separated list of columns names to display. It supports simple wildcards.
Supported values include:
alias(ora): The name of the alias.index(ori,idx): The name of the index the alias points to.filter(orf,fi): The filter applied to the alias.routing.index(orri,routingIndex): Index routing value for the alias.routing.search(orrs,routingSearch): Search routing value for the alias.is_write_index(orw,isWriteIndex): Indicates if the index is the write index for the alias.
Values are
alias,a,index,i,idx,filter,f,fi,routing.index,ri,routingIndex,routing.search,rs,routingSearch,is_write_index,w, orisWriteIndex. -
List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting
:ascor:descas a suffix to the column name. -
The type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. It supports comma-separated values, such as
open,hidden.Supported values include:
all: Match any data stream or index, including hidden ones.open: Match open, non-hidden indices. Also matches any non-hidden data stream.closed: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.hidden: Match hidden data streams and hidden indices. Must be combined withopen,closed, orboth.none: Wildcard expressions are not accepted.
Default value is
all. -
The period to wait for a connection to the master node. If the master node is not available before the timeout expires, the request fails and returns an error. To indicated that the request should never timeout, you can set it to
-1.Default value is
30s. -
Specifies the format to return the columnar data in, can be set to
text,json,cbor,yaml, orsmile.Default value is
text. -
When set to
truewill output available columns. This option can't be combined with any other query string option.Default value is
false. -
When set to
truewill enable verbose output.Default value is
false. -
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
1kbmeans 1024 bytes, not 1000 bytes. If omitted, byte-size values are rendered with a suffix such askb,mb, orgb, chosen such that the numeric value of the column is as small as possible whilst still being at least1.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 are
b,kb,mb,gb,tb, orpb. -
Sets the units for columns that contain a time duration. If omitted, time duration values are rendered with a suffix such as
ms,s,morh, chosen such that the numeric value of the column is as small as possible whilst still being at least1.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 are
nanos,micros,ms,s,m,h, ord.
GET _cat/aliases?format=json&v=true
resp = client.cat.aliases(
format="json",
v=True,
)
const response = await client.cat.aliases({
format: "json",
v: "true",
});
response = client.cat.aliases(
format: "json",
v: "true"
)
$resp = $client->cat()->aliases([
"format" => "json",
"v" => "true",
]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/aliases?format=json&v=true"
client.cat().aliases(a -> a);
[
{
"alias": "alias1",
"index": "test1",
"filter": "-",
"routing.index": "-",
"routing.search": "-",
"is_write_index": "true"
},
{
"alias": "alias1",
"index": "test1",
"filter": "*",
"routing.index": "-",
"routing.search": "-",
"is_write_index": "true"
},
{
"alias": "alias3",
"index": "test1",
"filter": "-",
"routing.index": "1",
"routing.search": "1",
"is_write_index": "true"
},
{
"alias": "alias4",
"index": "test1",
"filter": "-",
"routing.index": "2",
"routing.search": "1,2",
"is_write_index": "true"
}
]