tomoconnor/logstash_cleanout — pull request #2 by modulec (2013-04-05 11:28:36+00:00)
Title: Fixed indices deletion

So without this indentation the script is actually removing all the indices not only older than.

I was unfortunate to run this without inspecting the code so i ended up with empty logstash :-/

For example:

root@smc06:~/scripts# python cleanout.py --days 15
2013-04-05 12:48:13,494 - elastic_rotate - INFO - Deleting indices older than 15 days
2013-04-05 12:48:43,618 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.19
2013-04-05 12:48:55,346 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.18
2013-04-05 12:49:25,439 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.11
2013-04-05 12:49:35,909 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.10
2013-04-05 12:49:45,930 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.13
2013-04-05 12:49:52,259 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.12
2013-04-05 12:49:58,679 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.15
2013-04-05 12:50:06,039 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.14
2013-04-05 12:50:10,556 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.17
2013-04-05 12:50:28,563 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.16
2013-04-05 12:51:34,147 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.20
2013-04-05 12:51:44,150 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.21
2013-04-05 12:51:54,153 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.08
2013-04-05 12:52:04,156 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.09
2013-04-05 12:52:14,204 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.06
2013-04-05 12:52:24,208 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.07
2013-04-05 12:52:34,252 - elastic_rotate - INFO - DELETE INDEX logstash-2013.03.05
2013-04-05 12:52:52,244 - elastic_rotate - INFO - Deleted 32 indices