I am facing a strange issue with Filebeat on Windows :
I use it to consume log files generated with log4net. These files are configures to rotate every day. Filebeat is only watching the current file.
Everything works well (new lines are forwarded to Logstash) until the first hours of the day after tomorrow.
Every day between midnight and 2 or 3 o'clock Filebeat stop seeing file updates.
I think it is not due to file rotation because the first lines of the new day are well forwarded to Logstasg.
But after a while (20 minutes to 2 hours) nothing is forwarded anymore.
And if I restart the windows service, all skipped events are well forwarded and everything goes well until the next day in the morning.
I am using the RC1 of Filebeat and in the logs I can see the the last event published and then these lines till the end :
2015-11-18T02:02:07+01:00 DBG Start next scan
2015-11-18T02:02:07+01:00 DBG scan path d:/logs/application.log
2015-11-18T02:02:07+01:00 DBG Check file for harvesting: d:/logs/application.log
2015-11-18T02:02:07+01:00 DBG Update existing file for harvesting: d:/logs/application.log
2015-11-18T02:02:07+01:00 DBG Not harvesting, file didn't change: d:/logs/application.log
There is no error in the log file.
I know that I do not have much info for troubleshoot this issue but if you have any idea about this issue or suggestions to collect more info, do not hesitate !
@ruflin I've just installed the latest build and started the services. I'll give you feedback on monday after a few days of processing. Thanks for your efficiency.
Well it's a half a good news. I installed the latest build and restart Filebeat last Friday morning. It ran well and detected all changes till this morning at about 1 am. So it is really better but not totally fixed. As usual, I have restarted the windows service this morning and all events from 1 am to now were detected.
Here comes the logs of the last "good" scan :
2015-11-23T00:42:37+01:00 DBG Start next scan 2015-11-23T00:42:37+01:00 DBG scan path d:/logs/application.log 2015-11-23T00:42:37+01:00 DBG Check file for harvesting: d:/logs/application.log 2015-11-23T00:42:37+01:00 DBG Update existing file for harvesting: d:/logs/application.log 2015-11-23T00:42:37+01:00 DBG Not harvesting, file didn't change: d:/logs/application.log 2015-11-23T00:42:38+01:00 DBG Flushing spooler because of timemout. Events flushed: 0 2015-11-23T00:42:43+01:00 DBG Flushing spooler because of timemout. Events flushed: 0 2015-11-23T00:42:46+01:00 DBG Flushing spooler because spooler full. Events flushed: 1 2015-11-23T00:42:46+01:00 DBG Flushing spooler because spooler full. Events flushed: 1 2015-11-23T00:42:46+01:00 DBG send event 2015-11-23T00:42:46+01:00 DBG Start Preprocessing 2015-11-23T00:42:46+01:00 DBG Flushing spooler because spooler full. Events flushed: 1 2015-11-23T00:42:46+01:00 DBG Publish: { ... } 2015-11-23T00:42:46+01:00 DBG Forward preprocessed events 2015-11-23T00:42:46+01:00 DBG output worker: publish 1 events 2015-11-23T00:42:46+01:00 DBG Try to publish %!s(int=1) events to logstash with window size %!s(int=1024) 2015-11-23T00:42:46+01:00 DBG %!s(int=1) events out of %!s(int=1) events sent to logstash. Continue sending ... 2015-11-23T00:42:46+01:00 INFO Events sent: 1 2015-11-23T00:42:46+01:00 DBG send event 2015-11-23T00:42:46+01:00 DBG Start Preprocessing 2015-11-23T00:42:46+01:00 DBG Processing 1 events 2015-11-23T00:42:46+01:00 DBG Flushing spooler because spooler full. Events flushed: 1 2015-11-23T00:42:46+01:00 DBG Write registry file: d:\Applis\ELK\data\filebeat\filebeat.histovds.webservice.registry 2015-11-23T00:42:46+01:00 DBG Publish: { ... }
...
2015-11-23T00:42:46+01:00 DBG Forward preprocessed events 2015-11-23T00:42:46+01:00 DBG output worker: publish 1 events 2015-11-23T00:42:46+01:00 DBG Try to publish %!s(int=1) events to logstash with window size %!s(int=1024) 2015-11-23T00:42:46+01:00 DBG Processing 1 events 2015-11-23T00:42:46+01:00 DBG Write registry file: d:\Applis\ELK\data\filebeat\filebeat.histovds.webservice.registry 2015-11-23T00:42:46+01:00 INFO Registry file updated. 1 states written. 2015-11-23T00:42:46+01:00 DBG %!s(int=1) events out of %!s(int=1) events sent to logstash. Continue sending ... 2015-11-23T00:42:46+01:00 INFO Events sent: 1 2015-11-23T00:42:46+01:00 DBG Processing 1 events 2015-11-23T00:42:46+01:00 DBG Write registry file: d:\Applis\ELK\data\filebeat\filebeat.histovds.webservice.registry 2015-11-23T00:42:46+01:00 INFO Registry file updated. 1 states written.
And after the following sequence is repeated till I stop the service :
2015-11-23T00:42:47+01:00 DBG Start next scan 2015-11-23T00:42:47+01:00 DBG scan path d:/logs/application.log 2015-11-23T00:42:47+01:00 DBG Check file for harvesting: d:/logs/application.log 2015-11-23T00:42:47+01:00 DBG Update existing file for harvesting: d:/logs/application.log 2015-11-23T00:42:47+01:00 DBG Not harvesting, file didn't change: d:/logs/application.log 2015-11-23T00:42:53+01:00 DBG Flushing spooler because of timemout. Events flushed: 0
And there is also this line (which is expected) :
2015-11-23T00:47:51+01:00 ERR File reading error. Stopping harvester. Error: Stop harvesting as file is older then ignore_older: d:/logs/application.log; Last change was: 5m5.011712s
Our servers are VMs on a private cloud. I have to check whether any maintenance operation occurs this morning and could have prevent Filebeat to run correctly.
If I understand it right, the file which is not picked up again is the application.log file. It seems to happen after the first time that the harvester closes the because of ignore_older. Afterwards it changes again, but it seems like filebeat still decides that the file hasn't changed, correct?
This is unfortunately not so simple. I have checked the logs and I can see that harvester has already been closed in previous days due to ignore_older but following changes have been detected.
And I cannot see any abnormal activity in cloud cluster.
@ogauchard There is for the moment probably a quite simple solution. Increase ignore_older to 24h or at least higher then the longest update frequency of your files. Can you try that out?
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.