# Logstash: Error jdbc\_driver\_library not loaded

**URL:** <https://discuss.elastic.co/t/logstash-error-jdbc-driver-library-not-loaded/73654>\
**Category:** Logstash\
**Created:** [February 2, 2017, 10:41am UTC](https://discuss.elastic.co/t/logstash-error-jdbc-driver-library-not-loaded/73654 "2017-02-02T10:41:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zegdene](https://avatars.discourse-cdn.com/v4/letter/z/76d3ee/32.png) [@zegdene](https://discuss.elastic.co/u/zegdene)\
**Post date:** [February 2, 2017, 10:41am UTC](https://discuss.elastic.co/t/logstash-error-jdbc-driver-library-not-loaded/73654/1 "2017-02-02T10:41:46Z")

</div>

Hi,  
I need to get data from a PostgreSQL DB and index it into Elasticsearch. When I run /opt/logstash-2.3.3/bin/logstash -f contacts-index-logstash.conf I receive the following error:

Could not find log4j2 configuration at path /elk/logstash/config/log4j2.properties. Using default config which logs to console  
LoadError: no such file to load -- C:/elk/PostgreSQL/9.5/share/java/postgresql-9.4-1201.jre6  
require at org/jruby/RubyKernel.java:1040  
require at C:/elk/logstash/vendor/bundle/jruby/1.9/gems/polyglot-0.3.5/lib/polyglot.rb:65 load\_drivers at C:/elk/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.3/lib/logstash/plugin\_mixins/jdbc.rb:134  
each at org/jruby/RubyArray.java:1613  
load\_drivers at C:/elk/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.3/lib/logstash/plugin\_mixins/jdbc.rb:132  
prepare\_jdbc\_connection at C:/elk/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.3/lib/logstash/plugin\_mixins/jdbc.rb:146  
register at C:/elk/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.3/lib/logstash/inputs/jdbc.rb:191  
start\_inputs at C:/elk/logstash/logstash-core/lib/logstash/pipeline.rb:353  
each at org/jruby/RubyArray.java:1613  
start\_inputs at C:/elk/logstash/logstash-core/lib/logstash/pipeline.rb:352  
start\_workers at C:/elk/logstash/logstash-core/lib/logstash/pipeline.rb:228  
run at C:/elk/logstash/logstash-core/lib/logstash/pipeline.rb:183  
start\_pipeline at C:/elk/logstash/logstash-core/lib/logstash/agent.rb:292

---

<div class="post-metadata">

**Author:** ![Oleksii\_Mazilov](https://avatars.discourse-cdn.com/v4/letter/o/9de053/32.png) [@Oleksii\_Mazilov](https://discuss.elastic.co/u/Oleksii_Mazilov)\
**Post date:** [February 2, 2017, 11:04am UTC](https://discuss.elastic.co/t/logstash-error-jdbc-driver-library-not-loaded/73654/3 "2017-02-02T11:04:14Z")

</div>

Pls show your conf file

---

<div class="post-metadata">

**Author:** ![zegdene](https://avatars.discourse-cdn.com/v4/letter/z/76d3ee/32.png) [@zegdene](https://discuss.elastic.co/u/zegdene)\
**Post date:** [February 2, 2017, 11:12am UTC](https://discuss.elastic.co/t/logstash-error-jdbc-driver-library-not-loaded/73654/4 "2017-02-02T11:12:13Z")

</div>

hi ,

this is my conf file

# file: contacts-index-logstash.conf

input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:postgresql://localhost:5432/mydb"  
jdbc\_user =\> "postgres"  
jdbc\_validate\_connection =\> true  
jdbc\_driver\_library =\> "/elk/postgresql-9.4-1212.jre6.jar"  
jdbc\_driver\_class =\> "org.postgresql.Driver"  
statement =\> "SELECT \* from contacts"  
}  
}  
output {  
elasticsearch {  
hosts =\> ["[http://localhost:9200](http://localhost:9200)"]  
index =\> "contacts"  
document\_type =\> "contact"  
document\_id =\> "%{uid}"

```
}

```

}

---

<div class="post-metadata">

**Author:** ![Oleksii\_Mazilov](https://avatars.discourse-cdn.com/v4/letter/o/9de053/32.png) [@Oleksii\_Mazilov](https://discuss.elastic.co/u/Oleksii_Mazilov)\
**Post date:** [February 2, 2017, 11:29am UTC](https://discuss.elastic.co/t/logstash-error-jdbc-driver-library-not-loaded/73654/5 "2017-02-02T11:29:40Z")

</div>

> [@zegdene](#):
>
> jdbc\_driver\_library =\> "/elk/postgresql-9.4-1212.jre6.jar"

You need to specify full path to driver:  
Example: `jdbc_driver_library => "/usr/local/src/elk/postgresql-9.4-1212.jre6.jar"`  
Because in your case, JDBC plugin is trying to find driver in /elk folder in root

---

<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, 2017, 11:31am UTC](https://discuss.elastic.co/t/logstash-error-jdbc-driver-library-not-loaded/73654/6 "2017-03-02T11:31:03Z")

</div>

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