Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sort kibana indices by descending size?

I tried this first: GET _cat/indices which gave me all of my indices.

I added GET _cat/indices?v to get the column names so I would be able to sort by column name like this GET _cat/indices?v&s=store.size

Now, I just want to swap the sort order.

ElasticSearch guide had no information regarding this.

like image 997
CIsForCookies Avatar asked Jan 01 '23 03:01

CIsForCookies


1 Answers

You can use the suffix :desc like this to get there:

http://localhost:9200/_cat/indices/?s=store.size:desc

health status index                    uuid                   pri rep docs.count docs.deleted store.size pri.store.size
yellow open   tmdb                     DVLEul7bT4yGyiq34h4nCQ   1   1      27760            0    119.8mb        119.8mb
green  open   .kibana_2                6WJ3UFpOSj2O8zi-iLuw6w   1   0         10            0     35.3kb         35.3kb
green  open   .kibana_task_manager_1   WSwYXmMOSpyQOQ8ZIRniwg   1   0          2            0     31.6kb         31.6kb
green  open   .tasks                   _SsI5VWNSwO5Yfps3K12Qg   1   0          1            0      6.3kb          6.3kb
green  open   .kibana_1                MukHGTHfTkKS1HcYodfNqA   1   0          1            0        4kb            4kb
yellow open   my_index                 7FgIWDJOSQesKbJI-HKRoA   1   1          1            0      3.8kb          3.8kb
green  open   .ltrstore                -Xh6WnJYSsWIoPGP8fhgGw   1   0          0            0       283b           283b
green  open   .apm-agent-configuration 6FUF8T5oTDGcLBqcU7ymJg   1   0          0            0       283b           283b

This ability is mildly-buried/described-briefly in this section of the docs.

like image 73
Nate Avatar answered Jan 07 '23 17:01

Nate