Created
April 28, 2016 08:18
-
-
Save markuskont/7f94449409299e8762bdcecf30676c1f to your computer and use it in GitHub Desktop.
Delete moloch hourly indices that are RED
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
#!/bin/bash | |
for index in `curl -ss -XGET localhost:9200/_cat/indices?v | grep red | perl -ne 'if (m/.+(sessions-\d+\w\d+).+/){print "$1\n"}'` | |
do curl -XDELETE localhost:9200/$index | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment