Hi,
I've started log collection for a cassandra cluster and am seeing some odd behaviour.
That is, when I start the service in debug mode I see the log lines being processed and published to the remote logstash endpoint. However, after a period of time filebeat will start to claim the the log file hasn't changed when then are clearly lines waiting to be processed. The only way to deal with this is to restart the service.
Can you share the contents of /etc/filebeat/conf.d/ and your Filebeat log file with debug enabled? You can use http://pastebin.com if it won't all fit into a forum post.
I'm having the same problem, running filebeat 1.1.1. In my case, the logs are being rolled hourly. Occasionally, after a rollover filebeat seems to get "stuck" and the log output fills with lines like:
2016/04/13 16:00:00.552320 log.go:157: INFO Read line error: file inactive
2016/04/13 16:00:00.746876 log.go:157: INFO Read line error: file inactive
2016/04/13 16:00:02.955370 log.go:157: INFO Read line error: file inactive
2016/04/13 16:00:03.071145 log.go:157: INFO Read line error: file inactive
This despite the fact that the logs are being written. Then, after hours of this, we'll get a burst of where it seems to try and restart, with logs like:
2016/04/13 20:07:28.604003 log.go:157: INFO Read line error: file inactive
2016/04/13 20:49:36.432179 log.go:157: INFO Read line error: file inactive
2016/04/13 20:49:56.540290 log.go:113: INFO Harvester started for file: /storage/bro/logs/current/dns.log
2016/04/13 20:49:56.540288 log.go:113: INFO Harvester started for file: /storage/bro/logs/current/weird.log
2016/04/13 20:49:56.540288 log.go:113: INFO Harvester started for file: /storage/bro/logs/current/known_services.log
But despite those "Harvester started" messages repeating at odd intervals, sometimes intermixed with the "file inactive" messages, no data flows. Finally, after restarting, this is what a startup log looks like:
I've had another look at this. I see this in the log immediately after the last event gets published:
2016-04-13T18:01:56+01:00 DBG output worker: publish 76 events
2016-04-13T18:01:56+01:00 DBG output worker: publish 76 events
2016-04-13T18:01:56+01:00 DBG Try to publish 76 events to logstash with window size 15
2016-04-13T18:01:56+01:00 ERR Fail to convert the event to JSON: reflect: call of reflect.Value.IsNil on zero Value
2016-04-13T18:01:56+01:00 INFO Error bulk publishing events: reflect: call of reflect.Value.IsNil on zero Value
2016-04-13T18:01:56+01:00 DBG 15 events out of 76 events sent to logstash. Continue sending ...
2016-04-13T18:01:56+01:00 DBG Try to publish 61 events to logstash with window size 15
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG full line read
2016-04-13T18:01:56+01:00 DBG End of file reached: /var/log/cassandra/system.log; Backoff now.
2016-04-13T18:01:56+01:00 DBG 15 events out of 61 events sent to logstash. Continue sending ...
2016-04-13T18:01:56+01:00 DBG Try to publish 46 events to logstash with window size 15
2016-04-13T18:01:56+01:00 DBG 15 events out of 46 events sent to logstash. Continue sending ...
2016-04-13T18:01:56+01:00 DBG Try to publish 31 events to logstash with window size 15
2016-04-13T18:01:56+01:00 DBG 15 events out of 31 events sent to logstash. Continue sending ...
2016-04-13T18:01:56+01:00 DBG Try to publish 16 events to logstash with window size 15
2016-04-13T18:01:56+01:00 DBG 15 events out of 16 events sent to logstash. Continue sending ...
2016-04-13T18:01:56+01:00 DBG Try to publish 1 events to logstash with window size 15
2016-04-13T18:01:56+01:00 DBG 1 events out of 1 events sent to logstash. Continue sending ...
2016-04-13T18:01:56+01:00 DBG send completed
2016-04-13T18:01:57+01:00 DBG Start next scan
2016-04-13T18:01:57+01:00 DBG scan path /var/log/cassandra/*.log
2016-04-13T18:01:57+01:00 DBG Check file for harvesting: /var/log/cassandra/output.log
2016-04-13T18:01:57+01:00 DBG Update existing file for harvesting: /var/log/cassandra/output.log
2016-04-13T18:01:57+01:00 DBG Not harvesting, file didn't change: /var/log/cassandra/output.log
2016-04-13T18:01:57+01:00 DBG Check file for harvesting: /var/log/cassandra/system.log
2016-04-13T18:01:57+01:00 DBG Update existing file for harvesting: /var/log/cassandra/system.log
2016-04-13T18:01:57+01:00 DBG Not harvesting, file didn't change: /var/log/cassandra/system.log
...and then nothing is published until the service is restarted. From scanning publish events earlier in the log it seems that the error "Fail to convert the event to JSON" breaks log reading for that file...
2016-04-13T18:01:56+01:00 ERR Fail to convert the event to JSON: reflect: call of reflect.Value.IsNil on zero Value
Not sure if this is a bug in the standard library. Nightly builds do add the event to log output. Maybe this helps figuring out why json encoder trips.
this is super weird. I'd expect at least a stack-trace being printed if converting event to string failed.
I will need some sample logs and some shell script simulating the logrotation strategy implemented trying to reproduce issue. I haven't seen this problem before.
I didn't find an issue matching your case. Can you please open an issue with all details you have (logs, configs, versions)? Thanks.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.