Created
July 20, 2022 17:26
-
-
Save JasonGiedymin/90f701e603ee9a93eef5c9ac748d1b24 to your computer and use it in GitHub Desktop.
Quick sorting of elasticsearch indices by size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simple sort | |
curl --no-progress-meter --stderr - -X GET --user "<username>:<password>" "https://<host>:<port>/_cat/indices" | sort -g -k 7 | |
# if you want do do some formatting in between or what have you | |
curl --no-progress-meter --stderr - -X GET --user "<username>:<password>" "https://<host>:<port>/_cat/indices" | tr -s '[:blank:]' ',' | sort -g --field-separator=',' -k 7 | column -t -s ',' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment