Skip to content

Instantly share code, notes, and snippets.

@mpangrazzi
Last active September 15, 2016 08:03
Show Gist options
  • Save mpangrazzi/eb58de6a47ad62c5b79b210cdedcaa2e to your computer and use it in GitHub Desktop.
Save mpangrazzi/eb58de6a47ad62c5b79b210cdedcaa2e to your computer and use it in GitHub Desktop.
Delete all indexes in ElasticSearch
#!/bin/bash
curl 'localhost:9200/_cat/indices/' | awk '{ print $3 }' | xargs -I % curl -XDELETE 'localhost:9200/%'
# - useful if you can't delete using a wildcard
# - `xargs` can be swapped with `GNU parallel`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment