I'm tring to use logstash-7.6.2 to sync my mongo with elasticsearch. I'm using dbschema jdbc driver.
input {
jdbc{
jdbc_driver_class => "com.dbschema.MongoJdbcDriver"
jdbc_driver_library => "/home/user/mongojdbc2.3.jar,/home/user/mongo-java-driver-3.12.6.jar,/home/user/gson-2.8.6.jar"
jdbc_user => ""
jdbc_password => ""
jdbc_connection_string => "jdbc:mongodb://localhost:27027/test"
statement => "db.mycollection.find()"
}
}
output {
elasticsearch {
hosts => ["http://localhost:9220"]
manage_template => false
index => "testing"
}
stdout { codec => rubydebug }
}
But I catch the next error:
Error: Java::JavaSql::SQLException: No suitable driver found for jdbc:mongodb://localhost:27027/test Exception: Sequel::DatabaseConnectionError Stack: java.sql.DriverManager.getConnection(java/sql/DriverManager.java:689) java.sql.DriverManager.getConnection(java/sql/DriverManager.java:247)
I also tried to use the mongo native java driver and the unity jdbc driver. I also tried to use different version of mongo, tried from localhost and from a remote server. I tried to use different versions of logstash. Everything comes down to this error.