Hi All,
We are trying to get logs from MongoDB database using logstash jdbc plugin and below is the Logstash version :- 7.16.2
MongoDB version :- 4.2
MongoJDBC driver version :- mongojdbc4.1.jar (download jar from Download MongoDb JDBC Driver | Connect to MongoDb)
logstash code
input{
jdbc{
jdbc_driver_library => "/usr/share/logstash/mongodb/mongojdbc4.1.jar"
jdbc_driver_class => "Java::com.wisecoders.dbschema.mongodb.JdbcDriver"
jdbc_connection_string => "jdbc:mongodb://elkuser:elkuser@server:28020/elk_test?authSource=elk_test"
jdbc_user => "elkuser"
jdbc_password => "elkuser"
statement => "db.Object.find()"
}
}
output {
stdout {}
}
Connection established successfully with MongoDB but I'm getting below warning and no errors. No clue to fix this issue and Please help me how to resolve this issue or Do we have any alternative solution to get mongodb logs via logstash jdbc plugin Logstash logs :-
[INFO ] 2022-08-17 18:41:47.661 [cluster-ClusterId{value='62fcfe2a6e88c036b53c4476', description='null'}-server:28020] cluster - Monitor thread successfully connected to server with description ServerDescription{address:28020=lvenmngmdba01u.uat.emiratesnbd.com, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[4, 4, 6]}, minWireVersion=0, maxWireVersion=9, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=5762013} [INFO ] 2022-08-17 18:41:47.960 [[main]<jdbc] connection - Opened connection [connectionId{localValue:2, serverValue:17504}] to server:28020 Aug 17, 2022 6:41:48 PM com.wisecoders.dbschema.mongodb.wrappers.WrappedMongoClient pingServer INFO: Connected successfully to server. Aug 17, 2022 6:41:48 PM com.wisecoders.dbschema.mongodb.wrappers.WrappedMongoClient pingServer INFO: Connected successfully to server. Aug 17, 2022 6:41:49 PM com.wisecoders.dbschema.mongodb.MongoPreparedStatement executeQuery INFO: Execute db.Object.find() [To redirect Truffle log output to a file use one of the following options:
- '--log.file=' if the option is passed using a guest language launcher.
- '-Dpolyglot.log.file=' if the option is passed using the host Java launcher.
- Configure logging using the polyglot embedding API.] [engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. The guest application code will therefore be executed in interpreted mode only. Execution only in interpreted mode will strongly impact the guest application performance. For more information on using GraalVM see GraalVM. To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. [INFO ] 2022-08-17 18:41:59.813 [[main]<jdbc] jdbc - (10.212596s) db.Object.find() [INFO ] 2022-08-17 18:42:01.527 [[main]-pipeline-manager] javapipeline - Pipeline terminated {"pipeline.id"=>"main"} [INFO ] 2022-08-17 18:42:02.098 [Converge PipelineAction::Delete] pipelinesregistry - Removed pipeline from registry successfully {:pipeline_id=>:main} [INFO ] 2022-08-17 18:42:02.188 [LogStash::Runner] runner - Logstash shut down.
Logstash terminated after this message.
Thanks
Sundar