Start logstash error

I have configured the logstash.yml configuration file
logstash.yml:

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 9.3.8.0 (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, -Djava.security.egd=file:/dev/urandom, -Dlog4j2.isThreadContextMapInheritable=true, -Djruby.regexp.interruptible=true, -Djdk.io.File.enableADS=true, --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED, --add-opens=java.base/java.security=ALL-UNNAMED, --add-opens=java.base/java.io=ALL-UNNAMED, --add-opens=java.base/java.nio.channels=ALL-UNNAMED, --add-opens=java.base/sun.nio.ch=ALL-UNNAMED, --add-opens=java.management/sun.management=ALL-UNNAMED]
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/RubyKernel.java:790) ~[jruby.jar:?]
        at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:753) ~[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 {"pipeline.id"=>"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:
1
{
       "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.