# Invalid setting for jdbc streaming filter plugin

**URL:** <https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498>\
**Category:** Logstash\
**Created:** [February 1, 2020, 3:45pm UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498 "2020-02-01T15:45:15Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohan\_vel](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Mohan\_vel](https://discuss.elastic.co/u/Mohan_vel)\
**Post date:** [February 1, 2020, 3:45pm UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498/1 "2020-02-01T15:45:15Z")

</div>

Hi All i am trying to use jdbc streaming in logstash but i am getting below error.

Below is my config

input {  
jdbc {  
jdbc\_driver\_library =\> "mssql-jdbc-7.4.1.jre12-shaded"  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
jdbc\_connection\_string =\> "jdbc:sqlserver://EC2AMAZ-J90JR4A\SQLEXPRESS:1433;databaseName=xxx;"  
jdbc\_user =\> "xxx"  
jdbc\_password =\> "xxx"  
statement =\> "Select Policyholdername,Age,Policynumber,Dob,Client\_Address from policy"  
}  
}  
filter{  
jdbc\_streaming {  
jdbc\_driver\_library =\> "mssql-jdbc-7.4.1.jre12-shaded"  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
jdbc\_connection\_string =\> "jdbc:sqlserver://EC2AMAZ-J90JR4A\SQLEXPRESS:1433;databaseName=xxx;"  
jdbc\_user =\> "xxx"  
jdbc\_password =\> "xxx"  
statement =\> "select claimnumber,claimtype from claim where policynumber = :Policynumber"  
parameters =\> {"policynumber" =\> "policynumber"}  
target =\> "claim\_details"  
}  
}  
output {  
stdout { codec =\> rubydebug }  
}

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/5/851ab727c2182af9761b4bf0e472366587194474.png)

Also i have installed jdbc\_streaming plugin using below command  
logstash-plugin install logstash-filter-jdbc\_streaming  
it's installed successfully  
Could some one help me to resolve the issue.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 1, 2020, 4:15pm UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498/2 "2020-02-01T16:15:10Z")

</div>

It appears to be expanding the relative path into something that does not exist. Try using an absolute path for jdbc\_driver\_library.

---

<div class="post-metadata">

**Author:** ![Mohan\_vel](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Mohan\_vel](https://discuss.elastic.co/u/Mohan_vel)\
**Post date:** [February 1, 2020, 7:32pm UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498/3 "2020-02-01T19:32:08Z")

</div>

Hi Badger thanks for the reply attached screen shot for reference i have pasted the driver inside logstash and i have tried giving absolute path as suggested by you refer below code

filter{  
jdbc\_streaming {  
jdbc\_driver\_library =\> "D:/Users/mmurugesan/Desktop/logstash-7.2.0/logstash-core/lib/jars/mssql-jdbc-7.4.1.jre12-shaded"  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
jdbc\_connection\_string =\> "jdbc:sqlserver://EC2AMAZ-J90JR4A\SQLEXPRESS:1433;databaseName=xxxx;"  
jdbc\_user =\> "xxxx"  
jdbc\_password =\> "xxxx"  
statement =\> "select claimnumber,claimtype from claim where policynumber = :Policynumber"  
parameters =\> {"policynumber" =\> "policynumber"}  
target =\> "claim\_details"  
}

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/f/5fc215a743d704403a45057b736e1c9d86cb7ab6.png)

Still getting the same error

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/3/738f6ef24c9de5745e7410be5afc6467acc29ee7.png)

kindly suggest thanks in advance

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 1, 2020, 8:00pm UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498/4 "2020-02-01T20:00:14Z")

</div>

> [@Mohan\_vel](#):
>
> jdbc\_driver\_library =\> "D:/Users/mmurugesan/Desktop/logstash-7.2.0/logstash-core/lib/jars/mssql-jdbc-7.4.1.jre12-shaded"

I don't think you have File Explorer configured to show file extensions. Does

jdbc\_driver\_library =\> "D:/Users/mmurugesan/Desktop/logstash-7.2.0/logstash-core/lib/jars/mssql-jdbc-7.4.1.jre12-shaded.jar"

work?

---

<div class="post-metadata">

**Author:** ![Mohan\_vel](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Mohan\_vel](https://discuss.elastic.co/u/Mohan_vel)\
**Post date:** [February 2, 2020, 12:53pm UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498/5 "2020-02-02T12:53:14Z")

</div>

Badger, I have tried getting below error

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/c/accc4191c172582f8a1916abcb33ddd5dc029486.png)

I think if i give the absolute path of the driver it is saying that unable to load the driver refer above screenshot.  
Logstash-version-7.2.0  
SQLserver - 2014 express edition  
SQL driver - mssql-jdbc-7.4.1.jre12-shaded.jar  
java - javac 13.0.1

Even for jdbc input plugin if i give the absolute path it's not working. only if i paste the MSSql jdbc driver inside the logstash-7.2.0\logstash-core\lib\jars and make jdbc library as empty then only it's working fine. code given below.

input {  
jdbc {  
jdbc\_driver\_library =\> ""  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
jdbc\_connection\_string =\> "jdbc:sqlserver://EC2AMAZ-J90JR4A\SQLEXPRESS:1433;databaseName=xxxx;"  
jdbc\_user =\> "xxx"  
jdbc\_password =\> "xxxx"  
statement =\> "Select Policyholdername,Age,Policynumber,Dob,Client\_Address from policy"  
}  
}  
filter{

}  
output {  
stdout { codec =\> rubydebug }  
}

So ultimately if i give absolute path it's not working, any guess from your end.

---

<div class="post-metadata">

**Author:** ![inhinyera16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inhinyera16/32/61625_2.png) [@inhinyera16](https://discuss.elastic.co/u/inhinyera16)\
**Post date:** [February 3, 2020, 6:49am UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498/6 "2020-02-03T06:49:30Z")

</div>

Pls use sqljdbc4.jar and see my comment in your main post 🙂  
Also copy pasted my config

Hope it helps 🙂

---

<div class="post-metadata">

**Author:** ![Mohan\_vel](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Mohan\_vel](https://discuss.elastic.co/u/Mohan_vel)\
**Post date:** [February 3, 2020, 8:02am UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498/7 "2020-02-03T08:02:57Z")

</div>

Hi @inhinyera16

I have tried still getting below error.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/e/4e52328659cd1fe303970ccb8b2b1402354e07f0.png)

If i give absolute path of the driver location it saying failed to load driver. in screen shot it print the result in power shell because i place the driver in \logstash-7.2.0\logstash-core\lib\jars

input {  
jdbc {  
jdbc\_driver\_library =\> "D:/Users/mmurugesan/Desktop/driver/sqljdbc4.jar"  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
jdbc\_connection\_string =\> "jdbc:sqlserver://EC2AMAZ-J90JR4A\SQLEXPRESS:1433;databaseName=xxx;"  
jdbc\_user =\> "xxxx"  
jdbc\_password =\> "xxx"  
statement =\> "Select Policyholdername,Age,Policynumber,Dob,Client\_Address from policy"  
}  
}  
filter{

}  
output {  
stdout { codec =\> rubydebug }  
}

So my point is there is no issue with the driver because if i place it inside jars it's working fine but for abs path which i have provided is not working.

My driver folder is available in desktop attached screenshot.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/3/b34e1a4b7e8ed1d4a7ac374a10869b343976e920.png)

If i am doing something wrong basically pls let me know. Thank you

---

<div class="post-metadata">

**Author:** ![inhinyera16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inhinyera16/32/61625_2.png) [@inhinyera16](https://discuss.elastic.co/u/inhinyera16)\
**Post date:** [February 3, 2020, 8:11am UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498/8 "2020-02-03T08:11:05Z")

</div>

Hmm.

Can you put the jar file under {LS\_HOME}/logstash-core/lib/jars  
Then in your config file, make below parameters empty  
jdbc\_driver\_library =\> ""

---

<div class="post-metadata">

**Author:** ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)\
**Post date:** [February 3, 2020, 8:15am UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498/9 "2020-02-03T08:15:43Z")

</div>

@Mohan_vel - the error `TypeError: failed to coerce jdk.internal.loader.ClassLoaders$AppClassLoader to java.net.URLClassLoader` is a known [issue](https://github.com/logstash-plugins/logstash-filter-jdbc_static/issues/47) and has been fixed in:

- jdbc\_static filter plugin version 1.0.7 (c.f [Changelog](https://github.com/logstash-plugins/logstash-filter-jdbc_static/blob/v1.0.7/CHANGELOG.md)).
- jdbc\_streaming filter plugin version 1.0.10. This is a related [Github issue](https://github.com/logstash-plugins/logstash-filter-jdbc_streaming/pull/35) for this specific plugin and the [Changelog](https://github.com/logstash-plugins/logstash-filter-jdbc_streaming/blob/v1.0.10/CHANGELOG.md).

The problem in both plugins is actually the same problem and it is explained [here](https://github.com/logstash-plugins/logstash-filter-jdbc_static/issues/47#issuecomment-496602951).

If you could [update](https://www.elastic.co/guide/en/logstash/current/working-with-plugins.html#updating-plugins) the affected plugin to the latest version, that will solve your issue. You could then try to use the `jdbc_driver_library` with the JDBC driver file path.

The workaround to this issue is to place the JDBC driver in the Logstash Java classpath - which you tried and it works.

---

<div class="post-metadata">

**Author:** ![Mohan\_vel](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Mohan\_vel](https://discuss.elastic.co/u/Mohan_vel)\
**Post date:** [February 3, 2020, 9:42am UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498/10 "2020-02-03T09:42:44Z")

</div>

Hi @inhinyera16,

I have tried it it's not working for jdbc\_streaming alone it throws error invalid setting must be a path for jdbc\_streaming.

---

<div class="post-metadata">

**Author:** ![Mohan\_vel](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Mohan\_vel](https://discuss.elastic.co/u/Mohan_vel)\
**Post date:** [February 3, 2020, 10:51am UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498/11 "2020-02-03T10:51:21Z")

</div>

Hi @ropc -

I have upgraded my logstash from 7.2.0 to 7.5.2 loader issue has resolved. Thanks a lot. i have given my config file for reference.

```
input {
jdbc {
jdbc_driver_library => "D:/Users/xxxxx/Desktop/driver/mssql-jdbc-7.4.1.jre12-shaded.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://EC2AMAZ-J90JR4A\SQLEXPRESS:1433;databaseName=xxxx;"
jdbc_user => "xxxx"
jdbc_password => "xxx"
statement => "Select Policyholdername,Age,Policynumber,Dob,Client_Address from policy"
}
}
filter{
jdbc_streaming {
jdbc_driver_library => "D:/Users/xxxxxx/Desktop/driver/mssql-jdbc-7.4.1.jre12-shaded.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://EC2AMAZ-J90JR4A\SQLEXPRESS:1433;databaseName=xxxx;"
jdbc_user => "xxxx"
jdbc_password => "xxxx"
statement => "select claimnumber,claimtype from claim where policynumber = :policynumber"
parameters => {"policynumber" => "policynumber"}
target => "claim_details"
}
}
output {
stdout { codec => rubydebug }
}
```

---

<div class="post-metadata">

**Author:** ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)\
**Post date:** [February 3, 2020, 2:00pm UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498/12 "2020-02-03T14:00:29Z")

</div>

@Mohan_vel You're welcome 🙂 FYI - the issue was actually fixed in jdbc\_streaming filter plugin version 1.0.10 which is shipped in [Logstash 7.5.1](https://www.elastic.co/guide/en/logstash/current/logstash-7-5-1.html#_plugins_2). Upgrading the plugin or upgrading Logstash is the solution.

---

<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:** [March 2, 2020, 2:00pm UTC](https://discuss.elastic.co/t/invalid-setting-for-jdbc-streaming-filter-plugin/217498/13 "2020-03-02T14:00:36Z")

</div>

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