Skip to content

Instantly share code, notes, and snippets.

@deevis
Last active May 25, 2018 17:49
Show Gist options
  • Save deevis/2f972979cd821d5d46a2f97765ad3c3b to your computer and use it in GitHub Desktop.
Save deevis/2f972979cd821d5d46a2f97765ad3c3b to your computer and use it in GitHub Desktop.
Remove monitoring indexes from Elasticsearch - remove 'head' to delete them all
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
@deevis
Copy link
Author

deevis commented May 25, 2018

TO list all the indices:

curl http://es-cerebro.apps.domain.com:9200/_cat/indices | grep "monitoring-es" | sort

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment