Created
July 8, 2016 20:39
-
-
Save hartfordfive/1a9647a02273db1d38e1b32a001c7b56 to your computer and use it in GitHub Desktop.
One-line bash command to delete multiple Elasticsearch indices, based on a pattern
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
# Useful when the "action.disable_delete_all_indices" setting is set to "false" | |
for I in $(curl --silent 'http://[ES_HOST]:9200/_cat/indices/[INDEX_PATTERN]*?v&h=i'); do curl -XDELETE http://[ES_HOST]:9200/$I; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment