Problem is, very frequently kinesis agent runs into this error;
2017-08-28 17:43:55.277+0000 sse1-logstash2.pydt.lan (FileTailer[fh:dwh-logging-staging:/var/logstash/*]) com.amazon.kinesis.streaming.agent.tailing.SourceFileTracker [ERROR] E
rror while tracking file rotation for /var/logstash/*: file relative position changed (expected to be after position 2): TrackedFile(id=(dev=fd00,ino=134264416), path=/var/logs
tash/2017-08-28_10.10.40.163.log, lastModifiedTime=1503942105192, size=34193)
Current file: TrackedFile(id=(dev=fd00,ino=134264408), path=/var/logstash/2017-08-28_10.10.42.231.log, lastModifiedTime=1503942108466, size=239109)
Current file snapshot (newest first):
Then I modified the logstash configuration to write to a single log file per day, instead of per-host log files. This reduces the number of active log files to 1. Now the error doesn't happen. So it looks like the kinesis agent cannot handle monitoring multiple active log files in the same directory, using the filePattern "/directory/*".
Hello,
We have a logstash pipeline writing log files per host, per day into a directory. Logstash pipeline's output portion looks like this;
So the directory has log files like this, and all of them are active, and get written to very frequently;
And there is a kinesis agent monitoring this directory and sending the logs to a kinesis firehose. Kinesis agent configuration;
Problem is, very frequently kinesis agent runs into this error;
Then I modified the logstash configuration to write to a single log file per day, instead of per-host log files. This reduces the number of active log files to 1. Now the error doesn't happen. So it looks like the kinesis agent cannot handle monitoring multiple active log files in the same directory, using the filePattern "/directory/*".
Thanks Chaminda