How to automatically stop logstash process instance after its read the doc

I want to ask that, below is my code. With the below code logstash reads the file until its end. Then it is stops reading but process is still alive. I want that process stops when it finishes the reading. How can i do this ?

file {
        path => "directory/*.log"
        start_position => "beginning"
        mode => "read"

Thanks for answering

A file input will continue to tail the file, waiting for additional log messages to be written to it. It will not terminate the process.

There are a few inputs that will terminate the logstash process when they finish reading. For example, if you cat the file into a stdin input then when it reaches EOF it will terminate logstash.

1 Like

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