When my java application is updating the logs, logstash is re-reading the file from the begning and kibana is displaing twice the same file.
I tried with this configuration : input { file { path => "/home/ubuntu/ELK/examples/LogsFromLog4j/*.log" type => "oldLogs" sincedb_path => "/home/ubuntu/ELK/logstash-2.1.1/sincedb_log4j/sincedb_log4j.db" } }
and this : input { beats { type => beats port => 5044 } }
but in both cases I have duplicated logs.
It sounds like you're not really appending to the file but rather rewriting it. How, exactly, is the file being updated? It looks like you're using Log4j; which appender and how is it configured?
"on my test I opened the file and then modify it appending logs. "
Step 1 : mylogs.log -> empty
Step 2 : open file mylogs.log -> add new log in the file -> save file <dialogue> <server>localhost</server> <duration>165</duration> <outgoing><qvs_message appstate="getAPPSTATE_0"></qvs_record></qvs_message></outgoing> </dialogue>
--> mylogs.log = 1 Log
logstash (or filebeats) is reading the file the I can verify it with kibana and I have 1 log
Step 3 : open file mylogs.log -> add new log in the file -> save file <dialogue> <server>localhost</server> <duration>165</duration> <outgoing><qvs_message appstate="getAPPSTATE_1"></qvs_record></qvs_message></outgoing> </dialogue>
--> mylogs.log = 2 Log
logstash (or filebeats) is reading the file the I can verify it with kibana and I have 3 logs but Iextected 2 logs
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.