Skip to content

Instantly share code, notes, and snippets.

@markuskont
Created June 8, 2016 11:51
Show Gist options
  • Save markuskont/f4f4fb89ec0abdb28687ad7ba60fa36c to your computer and use it in GitHub Desktop.
Save markuskont/f4f4fb89ec0abdb28687ad7ba60fa36c to your computer and use it in GitHub Desktop.
use ES curator to delete old indices
#!/bin/bash
# apt-get install python-pip
# pip install elasticsearch-curator
RETAINDAYS=14
INDICES=( suricata apache cee syslog samba logstash )
for i in "${INDICES[@]}"
do
echo "${i}"
curator --host localhost delete indices --older-than $RETAINDAYS --time-unit days --timestring '%Y.%m.%d' --prefix "$i"
done
@markuskont
Copy link
Author

Old script. This no longer works with recent curator versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment