Elasticsearch list indices sorted by name

10 cls picture 10 cls · Jul 25, 2014 · Viewed 27.2k times · Source

How can the following query's results be sorted by index name?

curl "localhost:9200/_aliases?pretty"

Answer

Romain picture Romain · Dec 4, 2017

You can ask ES to sort the results via the s (sort) searchParameter using s=i or s=index

curl "localhost:9200/_cat/indices?pretty&s=i"
curl "localhost:9200/_cat/aliases?pretty&s=index"

To see the column's headers, add "&v" :

curl "localhost:9200/_cat/indices?pretty&v&s=index"`.

You can find some explanations in the cat/indices documentation