problem description:
I clearly set ignore_older => 86400, but there is always the problem of repeated collection of logs during use. How to solve this problem?
Can you provide more context about this? Share some examples of data?
The ignore_older will make Logstash ignore any files that haven't been modified in the specified time, in this case 86400 seconds, but if this file is modified it will no longer ignored.
Do you have files older than 86400 seconds that logstash did not ignore? Can you provide some evidence? Like the logs from those files and the result of the stat /path/file.log command on linux?
You didn't share the return of the stat command nor any evidence of the duplication, can you share that? Like a screenshot of Kibana showing duplicate lines.
atime is access time, it not necessarily mean that the file was changed.
What does this mean? You have daily logs? Or are you renaming the log file? What will happen with the log 2023-11-28.log when the day changes to 2023-11-29.log?
mode read - If read is specified, these settings can be used: ignore_older (older files are not processed)
start_position - Choose where Logstash starts initially reading files: at the beginning or at the end. The default behavior treats files like live streams and thus starts at the end. If you have old data you want to import, set this to beginning . * Default value is "end"
ignore_older - Use the string notation, easier to read
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.