-
Notifications
You must be signed in to change notification settings - Fork 100
SinceDB not updated properly with logstash-input-file(4.1.3) #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is unusual given the exact glob pattern you give
However, because changes are tracked by inode after a file is discovered, the content renamed from That said, in the code reorganisation during the change from 4.0.X to 4.1.X, some handling of renamed (rotated) files was messed up. This was fixed in 4.1.4 with this PR #192. It is quite tricky to handle these cases because the rename happens asynchronously to the loop which checks the There is a long standing understanding in our team about the problems with using paths or inodes to track changes in content because the path can change or the inode can be reused by the OS or the NFS mount is remounted with different device ids - so none of these mechanisms can uniquely identify content whether that content is a stream or a fixed written chunk. We regard file based content as streaming when the content pointed to by a path grows and then shrinks to (near) zero and grows again. We have discussed the use of one-way non crypto hashes (fingerprints) taken on fixed size chunks at known offsets as a better mechanism to identify content uniquely because when the path or inode changes we can say, via fingerprinting, that we have seen this content before and react appropriately. Fingerprinting is complex and we want to coordinate with Filebeat so we use similar algorithms etc. |
Thank you for your reply. I just upgrade logstash-input-file to 4.1.4. I am testing the plugin now. I also want to know whether logstash lost data during rotate. And i also found issue that report the data loss : #151 I want to know whether logstash fix this issue. Or we just need to use filebeat. |
@Tsukiand |
@guyboertje |
Closing. Fixed with 4.1.4 or later. |
I have use logstash 5.6.9 with logstash-input-file(4.1.3) And we just ingest data from /var/log/audit/*.log. But i found that logstash cpu usage up to 90%. I checked with the output events and there are many repeated events.
I have no filter and just output to files.
SinceDB: I have checked the sincedb file and i found that sincedb not updated when log rotate. First,i have a file audit.log with inode numeber 655414. I get the sinceDB file.
655414 0 2054 6291832 1536236943.678 /var/log/audit/audit.log
After log rotated. audit.log change to audit.log.1 with same inode number 655414 and new audit.log with inode number 655416. But sincedb not updated to the new log state. I get the sincedb file.
655414 0 2054 6291832 1536236958.220 /var/log/audit/audit.log
I have check the output file i found that logstash ingest audit.log.1 repeatedly making the events rate up to 10k per second.Then i check the source code. I think it is the shrink process making the file offset to zero and ingest the same log in the audit.log.1
And i have check why the sincedb was not updated. I found the code in discoverer.rb which cause the the issue. If our log rotate, it will not update the sincedb with proper inode and log path. And i try to add code to fix this for myself(bold fonts). I do not know whether it is a bug. Maybe i am use logstash in a wrong way. Please give me some advice.
The text was updated successfully, but these errors were encountered: