I am using logstash to read a log file. The file name reamins same but the content keeps changing for 1 hour(wipes off the previous logs and inserts new logs). But logstash is just reading last line of the file. Here is my config file,
It might be a sincedb issue? Logstash has logs to remember where it left off when parsing a certain file. Try going to your Logstash folder and clearing the sincedb folder (should be in "data"). Then do: file { path=>"C:logs/report.log" start_position => "beginning" type=>"ex" sincedb_path => "NUL" }
Hi Magnus, there is a cron job which replaces the content in the file every 1 hour, file name remains same. I've deleted sincedb folder and changed the config file but it still reads just the last line. Here is my config,
I've seen some instances where it only reads the last event. But now it's not reading at all. When I manually delete the content in file and add some content, logstash is reading the content but it's not doing automatically. Also I am running logstash.conf from a different path(not from logstash bin), will this be causing any issue?
I've seen some instances where it only reads the last event. But now it's not reading at all. When I manually delete the content in file and add some content, logstash is reading the content but it's not doing automatically.
Bumping up the log level to debug and looking for everything having to do with the reading of the file (including sincedb) might give useful clues.
Also I am running logstash.conf from a different path(not from logstash bin), will this be causing any issue?
Clues about what's going in inside Logstash, like what sincedb file (if any) it's reading, the current read position in a file, and so on.. I don't know what's wrong with your setup so I can't tell you exactly what to look for.
It's running continuously, they are pretty much the same logs that are being repeated. When you see the above logs, each:file grew...is another file in config, not the actual file I am looking for. (In the config I have multiple files)
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.