Skip to content

Instantly share code, notes, and snippets.

@featheredtoast
Created November 20, 2014 02:40
Show Gist options
  • Save featheredtoast/106209adb0ad1ddf8f86 to your computer and use it in GitHub Desktop.
Save featheredtoast/106209adb0ad1ddf8f86 to your computer and use it in GitHub Desktop.
ELK elasticsearch logrotate
#!/bin/sh
for i in 30 31 32 33 34 35
do
logdate=$(date --date='TZ="UTC" 09:00 '${i}' days ago' +"%Y.%m.%d")
curl -XDELETE "http://localhost:9200/logstash-${logdate}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment