Hello Dear ELkan's
Hope all are doing good!!.
here are details of my query:
Logstash version7.10 on Centos7.8
Using File input plugin to read files and forward logs to other components
Issue Statement : How can i read all file from a directory where .log files are getting rotated every hour without duplicating the data and loose any logs.
File pattern based on time eg. mainlog.log-2021042000
If you did path => "/data/mypath/tologs/mainlog.log-*" it will read all the files and there should be no duplicates as long as the files don't contain duplicates.
This part is telling it to start over from the beginning each time though. So once you get it working I would remove those and Logstash will maintain which logs and which data has been already ingested so it won't grab those again.
Thanks for quick turnaround.
Absolutely path => "/data/mypath/tologs/mainlog.log-*" will include all my log files, but the catch is same logs gets rotated every hour obviously its a duplicate data.
What's your recommendation for my scenario, where log files rotate every one hour.
Currently my configuration is pointing to active file where logging happens actively.
path => "/data/mypath/tologs/mainlog.log" ( im loosing data by this configuration)
while file rotates to next timestamp file
every hour new file is created
mainlog.log-2021042000
mainlog.log-2021042001
mainlog.log-2021042002 etc etc.
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.