Skip to content

Instantly share code, notes, and snippets.

@markuskont
Created April 28, 2016 08:18
Show Gist options
  • Save markuskont/7f94449409299e8762bdcecf30676c1f to your computer and use it in GitHub Desktop.
Save markuskont/7f94449409299e8762bdcecf30676c1f to your computer and use it in GitHub Desktop.
Delete moloch hourly indices that are RED
#!/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