This is an error message when running logstash.
error message:
Using bundled JDK: /home/admin/lg-862/jdk
Sending Logstash logs to /home/admin/lg-862/logs which is now configured via log4j2.properties
[2023-03-29T18:22:25,781][INFO ][logstash.runner ] Log4j configuration path used is: /home/admin/lg-862/config/log4j2.properties
[2023-03-29T18:22:25,789][WARN ][logstash.runner ] The use of JAVA_HOME has been deprecated. Logstash 8.0 and later ignores JAVA_HOME and uses the bundled JDK. Running Logstash with the bundled JDK is recommended. The bundled JDK has been verified to work with each specific version of Logstash, and generally provides best performance and reliability. If you have compelling reasons for using your own JDK (organizational-specific compliance requirements, for example), you can configure LS_JAVA_HOME to use that version instead.
[2023-03-29T18:22:25,790][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"8.6.2", "jruby.version"=>"jruby 9.3.10.0 (2.6.8) 2023-02-01 107b2e6697 OpenJDK 64-Bit Server VM 17.0.6+10 on 17.0.6+10 +indy +jit [x86_64-linux]"}
[2023-03-29T18:22:25,792][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]
[2023-03-29T18:22:25,921][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2023-03-29T18:22:26,367][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600, :ssl_enabled=>false}
[2023-03-29T18:22:26,522][INFO ][org.reflections.Reflections] Reflections took 90 ms to scan 1 urls, producing 127 keys and 444 values
[2023-03-29T18:22:26,976][INFO ][logstash.javapipeline ] Pipeline main
is configured with pipeline.ecs_compatibility: v8
setting. All plugins in this pipeline will default to ecs_compatibility => v8
unless explicitly configured otherwise.
[2023-03-29T18:22:26,996][INFO ][logstash.javapipeline ][main] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>500, "pipeline.sources"=>["/home/admin/lg-862/workshop.conf"], :thread=>"#<Thread:0x2911692b@/home/admin/lg-862/logstash-core/lib/logstash/java_pipeline.rb:131 run>"}
[2023-03-29T18:22:27,479][INFO ][logstash.javapipeline ][main] Pipeline Java execution initialization time {"seconds"=>0.48}
[2023-03-29T18:22:27,587][ERROR][logstash.javapipeline ][main] Pipeline error {:pipeline_id=>"main", :exception=>#<LogStash::ConfigurationError: Must set either :statement or :statement_filepath. Only one may be set at a time.>, :backtrace=>["/home/admin/lg-862/vendor/bundle/jruby/2.6.0/gems/logstash-integration-jdbc-5.4.1/lib/logstash/inputs/jdbc.rb:272:in `register'", "/home/admin/lg-862/vendor/bundle/jruby/2.6.0/gems/logstash-mixin-ecs_compatibility_support-1.3.0-java/lib/logstash/plugin_mixins/ecs_compatibility_support/target_check.rb:48:in `register'", "/home/admin/lg-862/logstash-core/lib/logstash/java_pipeline.rb:234:in `block in register_plugins'", "org/jruby/RubyArray.java:1865:in `each'", "/home/admin/lg-862/logstash-core/lib/logstash/java_pipeline.rb:233:in `register_plugins'", "/home/admin/lg-862/logstash-core/lib/logstash/java_pipeline.rb:392:in `start_inputs'", "/home/admin/lg-862/logstash-core/lib/logstash/java_pipeline.rb:317:in `start_workers'", "/home/admin/lg-862/logstash-core/lib/logstash/java_pipeline.rb:191:in `run'", "/home/admin/lg-862/logstash-core/lib/logstash/java_pipeline.rb:143:in `block in start'"], "pipeline.sources"=>["/home/admin/lg-862/workshop.conf"], :thread=>"#<Thread:0x2911692b@/home/admin/lg-862/logstash-core/lib/logstash/java_pipeline.rb:131 run>"}
[2023-03-29T18:22:27,588][INFO ][logstash.javapipeline ][main] Pipeline terminated {"pipeline.id"=>"main"}
[2023-03-29T18:22:27,590][ERROR][logstash.agent ] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create, action_result: false", :backtrace=>nil}
[2023-03-29T18:22:27,599][INFO ][logstash.runner ] Logstash shut down.
[2023-03-29T18:22:27,603][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.admin.lg_minus_862.lib.bootstrap.environment.(/home/admin/lg-862/lib/bootstrap/environment.rb:91) ~[?:?]
This is the conf file I ran.
input{
jdbc {
jdbc_connection_string => "jdbc:mongodb://XX.XX.XX.XX:27017/mytestdb"
jdbc_user => "admin"
jdbc_driver_library => "/home/admin/lg-862/logstash-core/lib/jars/mongo-java-driver-3.9.1-javadoc.jar"
jdbc_driver_class => "com.mongodb.MongoClient"
}
}
output{
stdout{ }
}
Is it possible to do logstash connection with mongoDB?