# Failed to configure JDBC Input Plugin with MongoDB

**URL:** <https://discuss.elastic.co/t/failed-to-configure-jdbc-input-plugin-with-mongodb/95254>\
**Category:** Logstash\
**Created:** [July 31, 2017, 11:56pm UTC](https://discuss.elastic.co/t/failed-to-configure-jdbc-input-plugin-with-mongodb/95254 "2017-07-31T23:56:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alejandrobarrios07](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alejandrobarrios07/32/21113_2.png) [@alejandrobarrios07](https://discuss.elastic.co/u/alejandrobarrios07)\
**Post date:** [July 31, 2017, 11:56pm UTC](https://discuss.elastic.co/t/failed-to-configure-jdbc-input-plugin-with-mongodb/95254/1 "2017-07-31T23:56:15Z")

</div>

Hello, I'm trying to set up logstash with JDBC to consume data from MongoDB without success.  
I am testing with the java drivers for MongoDb ([https://mongodb.github.io/mongo-java-driver/](https://mongodb.github.io/mongo-java-driver/)) in its different versions:

- mongodb-driver-3.4.2.jar
- mongo-java-driver-3.4. 2.jar
- mongodb-driver-core-3.4.2.jar

And using the following configuration:

```auto
input {
  jdbc {
    jdbc_connection_string => "jdbc:mongo://xxx.xxx.xxx.xxx:27017/database"
    jdbc_user => "user"
    jdbc_password => "password"
    jdbc_driver_library => "/etc/logstash/mongodb-java-driver-3.4.2.jar"
    jdbc_driver_class => "com.mongodb.MongoClient"
    statement => "SELECT * FROM table"
    schedule => "*/30 * * * *"
    tags => "mongodb"
  }
}

output {
  if "mongodb" in [tags] {
    stdout{}
    elasticsearch {
      index => "mongodb-%{+YYYY.MM.dd}"
      document_id => "%{uuid}"
      hosts => "localhost:9200"
    }
  }
}

```

And the log shows:

```auto
Sequel::DatabaseConnectionError
Java::JavaSql::SQLException: No suitable driver found for jdbc:mongo://xxx.xxx.xxx.xxx:27017

```

```auto
[2017-07-31T22:59:00,272][WARN][logstash.inputs.jdbc] Failed test_connection.
[2017-07-31T22:59:00,272][WARN][logstash.inputs.jdbc] Exception when executing JDBC query {:exception=>#<Sequel::DatabaseConnect
ionError: Java::JavaSql::SQLException: No suitable driver found for jdbc:mongo://xxx.xxx.xxx.xxx:27017>}
[2017-07-31T22:59:00,272][WARN][logstash.inputs.jdbc] Attempt reconnection.

```

What can be the error?

---

<div class="post-metadata">

**Author:** ![arunvijayam](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@arunvijayam](https://discuss.elastic.co/u/arunvijayam)\
**Post date:** [August 13, 2017, 4:51am UTC](https://discuss.elastic.co/t/failed-to-configure-jdbc-input-plugin-with-mongodb/95254/2 "2017-08-13T04:51:20Z")

</div>

Same problem facing any outcome

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 10, 2017, 4:51am UTC](https://discuss.elastic.co/t/failed-to-configure-jdbc-input-plugin-with-mongodb/95254/3 "2017-09-10T04:51:23Z")

</div>

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