I don't think there is a way to do that but it sounds like the application will only write to one file per day. Is that right? If so once filebeat completes reading the file, it won't read it anymore and will move on. Are you having an issue with the current setup?
Gotcha, ur trying to not import the old log files and only import everything from the day u install going forward? Can u not rename the old files to something so it doesn't match the pattern?
I guess u could do that, but the registry should track everything so even if u reinstall or restart filebeat, as long as the registry is persistent it should reread it
Idk if the exclude files is using globs or regex... to do it's filtering, I'd have to look at the documentation. But that still doesn't seem manageable in the long term. If nothing else works, I think the idea u had about having the file rotation change the name would probably be best long-term since it's automated.
If u use the default naming convention where the file names don't change and u get a new file each day, the registry should prevent previously read files from being reread even on restart and reinstall (provided the registry persists reinstall/update).
Thanks for adding the explanation of the registry.
I don't think there is any need to rewrite offset in cases where the number of files to be read is newly increased (i.e. logs in the format yyyy-mm-dd.log, etc.), because the same file name will not change the reading position.
In the case where the file name is changed due to log rotation (i.e., the log for the day is today.log, and the next day it is renamed to yyyy-mm-dd.log, etc.), it is not necessary to change the reading position of today.log. In this case, you need to change the reading position, so you need to change the offset and FileStateOS. In this case, you need to change the offset and FileStateOS.
However, I don't know how to set these.
In many operations, it only says to delete the registry if you want to re-read a log that has already been read. The only thing it says is that
I think it is a common case to rename files for log rotation, etc. What are the common means of doing this?
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.