Start logstash error

I have configured the logstash.yml configuration file

input {stdin{}} output {stdout{}}

But when I enter ./logstash to start, the following error occurs

[2023-07-12T01:16:59,926][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"8.6.0", "jruby.version"=>"jruby (2.6.8) 2022-09-13 98d69c9461 OpenJDK 64-Bit Server VM 17.0.5+8 on 17.0.5+8 +indy +jit [x86_64-linux]"}
[2023-07-12T01:16:59,930][INFO ][logstash.runner          ] JVM bootstrap flags: [-Xms1g, -Xmx1g, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djruby.compile.invokedynamic=true, -XX:+HeapDumpOnOutOfMemoryError,, -Dlog4j2.isThreadContextMapInheritable=true, -Djruby.regexp.interruptible=true,, --add-exports=jdk.compiler/, --add-exports=jdk.compiler/, --add-exports=jdk.compiler/, --add-exports=jdk.compiler/, --add-exports=jdk.compiler/, --add-opens=java.base/, --add-opens=java.base/, --add-opens=java.base/java.nio.channels=ALL-UNNAMED, --add-opens=java.base/,]
Your settings are invalid. Reason: Setting "" doesn't exist. Please check if you haven't made a typo.
[2023-07-12T01:16:59,949][FATAL][org.logstash.Logstash    ] Logstash stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
        at org.jruby.RubyKernel.exit(org/jruby/ ~[jruby.jar:?]
        at org.jruby.RubyKernel.exit(org/jruby/ ~[jruby.jar:?]
        at home.cetc.logstash_minus_8_dot_6_dot_0.lib.bootstrap.environment.<main>(/home/cetc/logstash-8.6.0/lib/bootstrap/environment.rb:91) ~[?:?]

I am puzzled. I cleared logstash.yml and used the command ./logstash -e ‘input {stdin{}} output {stdout{}}’, but it started successfully.

[2023-07-12T01:19:26,074][INFO ][logstash.javapipeline    ][main] Pipeline Java execution initialization time {"seconds"=>0.92}
[2023-07-12T01:19:26,108][INFO ][logstash.javapipeline    ][main] Pipeline started {""=>"main"}
[2023-07-12T01:19:26,122][INFO ][logstash.agent           ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
The stdin plugin is now waiting for input:
       "message" => "1",
    "@timestamp" => 2023-07-11T17:19:31.424360581Z,
         "event" => {
        "original" => "1"
          "host" => {
        "hostname" => "cetc-virtual-machine"
      "@version" => "1"

The input/filter/output configuration should not be in logstash.yml, it should be in a file pointed to by path.config. You can set path.config in logstash.yml, or on the command line using -f.

What i do is usually:

Inside my_logstash_pipeline.conf:

input {stdin{}} output {stdout{}}

Then i go to etc/logstash (the same level with config) and start it.

./bin/logstash -f my_logstash_pipeline.conf

Make sure that there is no logstash running: sudo systemctl status logstash

You can define multiple pipelines in pipeline.yml file. Then start logstash automatically with: sudo systemctl start logstash

Or sudo systemctl restart logstash
Or sudo systemctl stop logstash

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