Cleanup old ES logs
Keep elasticsearch from fillings its disk with logs by deleting logs older than two weeks. Note we do not use logrotate because elasticsearch expects to be doing the log rotation itself, it just doesn't delete older logs. Instead we setup a cron with find to delete the older logs. Change-Id: Ia2611cbf6e4aa1945ec8b3914d7ba042d2a7b0c1
This commit is contained in:
parent
da4dbde4fe
commit
0c638194c0
|
@ -124,4 +124,13 @@ class elasticsearch (
|
|||
group => 'root',
|
||||
mode => '0644',
|
||||
}
|
||||
|
||||
cron { 'cleanup-es-logs':
|
||||
command => 'find /var/log/elasticsearch -type f -mtime +14 -delete',
|
||||
user => 'root',
|
||||
hour => '6',
|
||||
minute => '7',
|
||||
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin',
|
||||
require => Package['elasticsearch'],
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue