Skip to content

Instantly share code, notes, and snippets.

@drewr
Created July 4, 2017 18:14
Show Gist options
  • Save drewr/a52c202be4785713edc2100188e73242 to your computer and use it in GitHub Desktop.
Save drewr/a52c202be4785713edc2100188e73242 to your computer and use it in GitHub Desktop.
Deleting all the closed indices in a cluster
ES=http://localhost:9200
curl -s ${ES}/_cat/indices\?h=status,index | \
awk '/^close/ { print $2 }' | \
while read i; do echo curl -s -XDELETE ${ES}/$i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment