Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JasonGiedymin/90f701e603ee9a93eef5c9ac748d1b24 to your computer and use it in GitHub Desktop.
Save JasonGiedymin/90f701e603ee9a93eef5c9ac748d1b24 to your computer and use it in GitHub Desktop.
Quick sorting of elasticsearch indices by size
# 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