Logstash and mongodb connection error

input{
jdbc{
jdbc_driver_library => "/home/admin/lg-862/lgstash-core/lib/jars/mongojdbc4.8.jar"
jdbc_driver_class => "Java::com.wisecoders.dbschema.mongodb.JdbcDriver"
jdbc_connection_string => "mongodb://XXXXXX:XXXXXX@XXX.XXX.XX.XX:27017/mytestdb"
jdbc_user => "XXXXXXX"
jdbc_password => "XXXXX"
statement => "db.getCollection('testcoll').find({})"

}

}

output{
stdout{ }
}

./bin/logstash -f workshop.conf
Using bundled JDK: /home/admin/lg-862/jdk
jruby: warning: unknown property jruby.version
Sending Logstash logs to /home/admin/lg-862/logs which is now configured via log4j2.properties
[2023-04-03T14:41:22,746][INFO ][logstash.runner ] Log4j configuration path used is: /home/admin/lg-862/config/log4j2.properties
[2023-04-03T14:41:22,752][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-04-03T14:41:22,752][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 +jit [x86_64-linux]"}
[2023-04-03T14:41:22,754][INFO ][logstash.runner ] JVM bootstrap flags: [-Djruby.version=9.2.13.0, -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-04-03T14:41:22,887][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2023-04-03T14:41:23,254][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600, :ssl_enabled=>false}
[2023-04-03T14:41:23,485][INFO ][org.reflections.Reflections] Reflections took 102 ms to scan 1 urls, producing 127 keys and 444 values
[2023-04-03T14:41:23,888][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-04-03T14:41:23,907][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:0x6d34d575@/home/admin/lg-862/logstash-core/lib/logstash/java_pipeline.rb:131 run>"}
[2023-04-03T14:41:24,409][INFO ][logstash.javapipeline ][main] Pipeline Java execution initialization time {"seconds"=>0.5}
[2023-04-03T14:41:24,633][ERROR][logstash.javapipeline ][main] Pipeline error {:pipeline_id=>"main", :exception=>#<LogStash::PluginLoadingError: unable to load /home/admin/lg-862/lgstash-core/lib/jars/mongojdbc4.8.jar from :jdbc_driver_library, file not readable (please check user and group permissions for the path)>, :backtrace=>["/home/admin/lg-862/vendor/bundle/jruby/2.6.0/gems/logstash-integration-jdbc-5.4.1/lib/logstash/plugin_mixins/jdbc/common.rb:59:in `block in load_driver_jars'", "org/jruby/RubyArray.java:1865:in `each'", "/home/admin/lg-862/vendor/bundle/jruby/2.6.0/gems/logstash-integration-jdbc-5.4.1/lib/logstash/plugin_mixins/jdbc/common.rb:54:in `load_driver_jars'", "/home/admin/lg-862/vendor/bundle/jruby/2.6.0/gems/logstash-integration-jdbc-5.4.1/lib/logstash/plugin_mixins/jdbc/common.rb:34:in `load_driver'", "/home/admin/lg-862/vendor/bundle/jruby/2.6.0/gems/logstash-integration-jdbc-5.4.1/lib/logstash/inputs/jdbc.rb:307: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:0x6d34d575@/home/admin/lg-862/logstash-core/lib/logstash/java_pipeline.rb:131 run>"}
[2023-04-03T14:41:24,634][INFO ][logstash.javapipeline ][main] Pipeline terminated {"pipeline.id"=>"main"}
[2023-04-03T14:41:24,641][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-04-03T14:41:24,650][INFO ][logstash.runner ] Logstash shut down.
[2023-04-03T14:41:24,654][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) ~[?:?]

I want to solve this problem please help

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