sortingelasticsearchalias

How to get a list of Elasticsearch indices sorted by name?


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

curl "localhost:9200/_aliases?pretty"

Solution

  • I think that the best way to do this would be via the console. Something like this:

    $ curl --silent 'http://path.to.cluster:9200/_cat/indices' | cut -d ' ' -f2 | sort