How to test logstash .conf file easily without logstash shutting down everytime?

I'm currently testing the logstash in below manner.
/opt/logstash/bin/logstash -f /tmp/simpleInputs.conf

This works perfectly, but the issue is, it takes some time to execute it.. just for the starting of java process , spinning up and shutting down etc.. so for every small test I can see it takes around 47 seconds. out of those , the actual running time of the conf is less than 1 second ! .. so when im testing 40-50 conf file, it takes enormous time which ideally should have processed in seconds

Is there an option, whereby I can "put" a conf file and get output instantly without re-spawning the entire logstash process from start & shutdown? What i'm looking for is something like is to inject a .conf file to an already running/existing logstash process?

myInjectScript  -f /tmp/simpleInputs.conf

If you use the --config.reload.automatic option on the command line then each time you modify / overwrite the configuration logstash will try to restart the pipeline, which will cause the new file to be read.

Some pipelines cannot be restarted. For example, a stdin input cannot be restarted.

1 Like

@Badger , thanks mate for the reply
I got your idea. But can you please clarify if my below understanding is correct?

  • Run my first pipeline normally with --config.reload.automatic
  • and afterwards, just changing contents of the same pipeline

Yes, run

/opt/logstash/bin/logstash -f /tmp/simpleInputs.conf --config.reload.automatic

and then edit, or overwrite, /tmp/simpleInputs.conf

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