Logstash file read basic question

please point me in the right direction. I just started with logstash. Thanks

My config file
cat test.conf
input { file { path => "/localhome/user/test.txt" start_position => "beginning" } } filter { grok { match => { "message" => "%{NUMBER:age},%{WORD:name}" } } } output { file { path => "/localhome/user/outfile.txt" } }
started logstash as
logstash -f test.conf
Logstash startup completed

Now i created a test file as below
cat test.txt

save the file, and i am expecting to see a new file output.txt with three records
but this is what i got
cat outfile.txt

why is it reading only the first record?

Now i edited the file test.txt and added one more record
now this is what i see in output.txt

]cat outfile.txt

didn't quite understand this behavior, why is it not reading the whole file? why is it missing the last record and also repeating the first record?

You need to set sincedb_path to something like /dev/null.

Take a read of https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html#plugins-inputs-file-sincedb_path

yes, i cleared $HOME/.sincedb* before starting logstash

with no .sincedb files, with no data file, i started logstash
and then created a new data file. then i expect it to auto read the entire file form the beginning and write it to output file, but in output file i only see 1 line in first pass.