Last active
May 25, 2018 17:49
-
-
Save deevis/2f972979cd821d5d46a2f97765ad3c3b to your computer and use it in GitHub Desktop.
Remove monitoring indexes from Elasticsearch - remove 'head' to delete them all
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
for index in `curl http://es-cerebro.apps.domain.com:9200/_cat/indices | grep "monitoring-es-6" | sort | head | sed 's/-.\{11\}\).*1 1.*/\1/g'`; do echo -e "\nDeleting: $index"; curl -X DELETE "http://es-cerebro.apps.verisys.com:9200/$index"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TO list all the indices:
curl http://es-cerebro.apps.domain.com:9200/_cat/indices | grep "monitoring-es" | sort