I am looking into why my disks are getting full and I found that filebeat is holding handles on logs that are rotated. I read some discussions on the topic and I did not see a definitive answer and all requests were rather old. I am running Filebeat 7.7.1 - I loaded lsof on a host to show what I am seeing. filebeats has been running for 2 weeks on this host and it has almost 3000 rotated logs that look like this.
filebeat 39160 113647 root 226r REG 253,2 10494498 263635 /opt/active/logs/FoundationEmailService52.10.log (deleted)
filebeat 39160 113647 root 227r REG 253,2 10485895 263636 /opt/active/logs/FoundationEmailService52.10.log (deleted)
filebeat 39160 113647 root 228r REG 253,2 10519906 263637 /opt/active/logs/FoundationEmailService52.10.log (deleted)
filebeat 39160 113647 root 229r REG 253,2 10488865 263638 /opt/active/logs/FoundationEmailService52.10.log (deleted)
filebeat 39160 113647 root 230r REG 253,2 10527631 263639 /opt/active/logs/FoundationEmailService52.10.log (deleted)
filebeat 39160 113647 root 231r REG 253,2 10486116 263640 /opt/active/logs/FoundationEmailService52.10.log (deleted)
filebeat 39160 113647 root 232r REG 253,2 10534540 263642 /opt/active/logs/FoundationEmailService52.10.log (deleted)
is there a setting somewhere that can fix this. here is my filebeat-yml it is very basic'
[root@prod-email-102w config]# cat filebeat-app.yml
filebeat.inputs:
- type: log
enabled: true
paths:
- /opt/active/logs/*.log
exclude_files: ['-gc\.log$','-tracer.*','\.\d+\.log$']
multiline:
pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'
match: after
negate: True
filebeat.config.inputs:
enabled: true
path: ${path.config}/inputs.d/*.yml
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.template.settings:
index.number_of_shards: 1
output.logstash:
hosts: [SERVERS REMOVED FOR PROTECTION ]
processors:
- add_locale: ~
logging.level: info
logging.to_files: true
logging.files:
path: /opt/filebeat/logs
name: app.log
keepfiles: 7
permissions: 0644