Advertisement
esolitos

Logstash cleanup

Apr 19th, 2016
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.63 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. elastic_admin_ip=192.168.193.225
  4. elastic_admin_port=9200
  5.  
  6. index_close_days=10
  7. index_remove_days=15
  8.  
  9. #log_level=ERROR
  10. log_level=INFO
  11. DEFAULT_OPTIONS=' --time-unit days --timestring "%Y.%m.%d" --prefix logstash'
  12.  
  13. # Delete indexes older than specified
  14. /usr/local/bin/curator --loglevel "$log_level" --host "$elastic_admin_ip" --port "$elastic_admin_port" delete indices --older-than "$index_remove_days" ${DEFAULT_OPTIONS}
  15.  
  16. # ..and close the slightly older.
  17. /usr/local/bin/curator --loglevel ${log_level} --host ${elastic_admin_ip} --port ${elastic_admin_port} close indices --older-than ${index_close_days} ${DEFAULT_OPTIONS}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement