# Bad JDBC connection string

**URL:** <https://discuss.elastic.co/t/bad-jdbc-connection-string/193551>\
**Category:** Logstash\
**Created:** [August 2, 2019, 1:56pm UTC](https://discuss.elastic.co/t/bad-jdbc-connection-string/193551 "2019-08-02T13:56:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![valleram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/valleram/32/48248_2.png) [@valleram](https://discuss.elastic.co/u/valleram)\
**Post date:** [August 2, 2019, 1:56pm UTC](https://discuss.elastic.co/t/bad-jdbc-connection-string/193551/1 "2019-08-02T13:56:20Z")

</div>

Hi,

Trying to connect to a local MySql db using jdbc\_streaming filter but receiving below error.

`[ERROR] 2019-08-02 08:46:51.709 [[main]-pipeline-manager] pipeline - Error registering plugin {:pipeline_id=>"main", :plugin=>"#<LogStash::FilterDelegator:0x1afd0eca>", :error=>"Sequel::DatabaseError: driver.new.connect returned nil: probably bad JDBC connection string",`

This is my filter configuration for Logstash 6.8.1.

```
filter {
      jdbc_streaming {
        jdbc_driver_library => "/usr/share/java/mysql-connector-java.jar"
        jdbc_driver_class => "com.mysql.jdbc.Driver"
        jdbc_connection_string => "jdbc:mysql:/var/lib/mysql/sensor_metadata"
        jdbc_user => "sample"
        jdbc_password => "password"
        statement => "select st.sensor_type as sensorType, l.customer as customer, l.department as department, l.building_name as buildingName, l.room as room, l.floor as floor, l.location_on_floor as locationOnFloor, l.latitude, l.longitude from sensors s inner join sensor_type st on s.sensor_type_id=st.sensor_type_id inner join location l on s.location_id=l.location_id where s.sensor_id= :sensor_identifier"
        parameters => { "sensor_identifier" => "sensor_id"}
        target => lookupResult
      }

      mutate {
        rename => {"[lookupResult][0][sensorType]" => "sensorType"}
        rename => {"[lookupResult][0][customer]" => "customer"}
        rename => {"[lookupResult][0][department]" => "department"}
        rename => {"[lookupResult][0][buildingName]" => "buildingName"}
        rename => {"[lookupResult][0][room]" => "room"}
        rename => {"[lookupResult][0][floor]" => "floor"}
        rename => {"[lookupResult][0][locationOnFloor]" => "locationOnFloor"}
        add_field => {
          "location" => "%{[lookupResult][0][latitude]},%{[lookupResult][0][longitude]}"
        }
        remove_field => ["lookupResult", "headers", "host"]
      }

    }

```

Can someone please help me

Thank you!

---

<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:** [August 30, 2019, 1:56pm UTC](https://discuss.elastic.co/t/bad-jdbc-connection-string/193551/2 "2019-08-30T13:56:21Z")

</div>

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