Filebeat is not shipping logs from specific hosts, whereas everything is identical compared to another hosts where it is successfully shipping the logs.
I have 3 hosts from where filebeat is shipping logs to logstash server eventually adding to elastic cluster.
Filebeat successfully ships the logs from one server node having exact same prospectors and configurations, but doesn't from another two server nodes.
All 3 server nodes are been configured with puppet configurations, so are having exact same filebeat version, certificate and log files formats.
Here is config I am using to ship the logs,
filebeat.prospectors:
- input_type: log
paths:
- /home/appster/logs/service_logs_*
document_type: serviceLogs
fields:
type: serviceLogs
fields_under_root: true
exclude_files: [".gz$"]
close_inactive: 15m
close_renamed: true
close_removed: true
close_eof: true
multiline.pattern: '^<[0-9]{4}-[0-9]{2}-[0-9]{2}|[1]{2}-[0-9]{2}-[0-9]{4}|[2]{4}-[0-9]{2}-[0-9]{2}|[3][a-z]{2} [0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}'
multiline.negate: true
multiline.match: after
output.logstash:
hosts: ["logstash.myserver.com:5044"]
bulk_max_size: 4096
worker: 2
pipelining: 10
compression_level: 4
index: logstash
ssl.certificate_authorities: ["/etc/pki/tls/certs/logstash-forwarder.crt"]
ssl.certificate: "/etc/pki/tls/certs/filebeat.crt"
ssl.key: "/etc/pki/tls/private/filebeat.key"
The only difference in working and non-working hosts is number of files,
==> Working server node
ls -l /home/servicelogs/logs/ | wc -l
6138
==> NON Working server node
HOST 1
> ls -ltr /home/servicelogs/logs | wc -l
310238
HOST 2
> ls -l /home/servicelogs/logs/ | wc -l
65834
I had millions of ununsed file in /tmp directory, so I had recently cleaned all those files, but still not getting any logs on logstash server.
Though I am seeing logs are been published in debug logs, but no logs are seen on logstash server,
2017-01-09T15:37:23Z INFO Non-zero metrics in the last 30s: registrar.writes=6 registrar.states.update=121 publish.events=121
2017-01-09T15:37:23Z DBG Flushing spooler because of timeout. Events flushed: 26
2017-01-09T15:37:23Z DBG No events to publish
2017-01-09T15:37:23Z DBG Events sent: 26
2017-01-09T15:37:23Z DBG Processing 26 events
2017-01-09T15:37:23Z DBG Registrar states cleaned up. Before: 5085 , After: 5085
2017-01-09T15:37:23Z DBG Write registry file: /var/lib/filebeat/registry
2017-01-09T15:37:23Z DBG Registry file updated. 5085 states written.
2017-01-09T15:37:28Z DBG Flushing spooler because of timeout. Events flushed: 25
2017-01-09T15:37:28Z DBG No events to publish
2017-01-09T15:37:28Z DBG Events sent: 25
2017-01-09T15:37:28Z DBG Processing 25 events
2017-01-09T15:37:28Z DBG Registrar states cleaned up. Before: 5085 , After: 5085
2017-01-09T15:37:28Z DBG Write registry file: /var/lib/filebeat/registry
2017-01-09T15:37:28Z DBG Registry file updated. 5085 states written.
2017-01-09T15:37:33Z DBG Flushing spooler because of timeout. Events flushed: 26
2017-01-09T15:37:33Z DBG No events to publish
2017-01-09T15:37:33Z DBG Events sent: 26
2017-01-09T15:37:33Z DBG Processing 26 events
2017-01-09T15:37:33Z DBG Registrar states cleaned up. Before: 5085 , After: 5085
2017-01-09T15:37:33Z DBG Write registry file: /var/lib/filebeat/registry
2017-01-09T15:37:33Z DBG Registry file updated. 5085 states written.
2017-01-09T15:37:38Z DBG Flushing spooler because of timeout. Events flushed: 14
2017-01-09T15:37:38Z DBG No events to publish
2017-01-09T15:37:38Z DBG Events sent: 14
2017-01-09T15:37:38Z DBG Processing 14 events
2017-01-09T15:37:38Z DBG Registrar states cleaned up. Before: 5085 , After: 5085
2017-01-09T15:37:38Z DBG Write registry file: /var/lib/filebeat/registry
2017-01-09T15:37:38Z DBG Registry file updated. 5085 states written
OS: Ubuntu 12.04
Versions:
Logstash server 5.0, Filebeat 5.0.2, Elasticsearch 5.0