Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hartfordfive/1a9647a02273db1d38e1b32a001c7b56 to your computer and use it in GitHub Desktop.
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
# 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