How To Make Logstash Read Entire File Every Time Which is from File Beat?

input {
beats {
port => 5048
}
}

output {
stdout { codec => rubydebug }
file
{
codec => line {
format => "%{[message]}"
}
path => "C:/Program Files/logstash-6.2.3/testPractice/LogsCollected/DebugLog09May2018/OneTwo.html}
}

For first time OneTwo.html is read its fine , from second time when OneTwo.html changes
Content is appended at bottom and that too not properly

Filebeat is designed to tail a log file and read new lines as they are appended to it. It is not designed to do what you are asking for.

Yeah got it but in this case
say like in original file I ve 2 lines
a
b

We've modified one line say 'a'
now output file is like

a -- original data
b
a -- modified data
b

I am expecting it to be like log file to have only two lines as with my original log file which has two lines , but with modified data in one of lines

a -- modified data
b

I cannot think of a way to do that with beats and logstash.

Is there a way to achieve this by having input as log stash in place of file beats (or) any other alternative?

It sounds like you are trying to do remote file replication. logstash is not the right tool.

Can you please suggest any tool for doing remote file replication for MAC OSX (or) Windows OS, Thanks in advance

rsync.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.