-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Logparser does not detect file that has been deleted and recreated. #2847
Comments
Here is a test case #2965 |
I can also confirm this issue with telegraf 1.3.4 on debian jessie with python logger doing the logging. |
Hi guys, was this issues fixed in the latest version of telegraf? |
No this is still an issue. |
In version 1.4.5 the problem is reproduced |
Think this is related: hpcloud/tail#122. https://github.com/hpcloud/tail/pull/125/files fixes the issues for me (keeping deleted file open). maybe that commit can be merged in https://github.com/influxdata/tail if upstream library doesn't. |
@piotr1212 That change looks like it introduces a race condition, I don't think it is the right change to make but it might be a clue how to fix this issue. Also it should probably be opened in the fsnotify project and not in tail. |
That is unfortunate. I forgot to mention that we had a full disk because of logparser plugin keeping a deleted (rotated) file open. Switched to "poll" method which seems not to be affected. |
Does this issue still persist with |
I've just stumbled upon an issue that looks very similar to this using
The initial post never mentioned a log message so I cannot say if this is the exact same issue, but it certainly looks like it. |
Closing as logparser is deprecated. If you are having problems with tail please open a new issue :) |
Bug report
The fixes implemented in #1829 did not address the case where a file being watched by the Logparser plugin is deleted and recreated.
Relevant telegraf.conf:
System info:
Telegraf v1.3.0 (git: release-1.3 2bc5594)
Tested on CentOS 6.7
Steps to reproduce:
Run this bash script. It first tests the case similar to log rolling where the original file is moved. It next tests the delete case where the original file is deleted and a new file of the same name is created.
Results
Expected behavior:
The results of the test should be the same regardless of whether the file is deleted or moved.
Actual behavior:
When file is deleted the Logparser is no longer able to detect that a new file of the same name was created.
Use case:
Our use case is that the log we are monitoring is always in the same place. It gets purged and recreated when the the service doing the logging is upgraded.
The text was updated successfully, but these errors were encountered: