# Unable to get Postgres for Logstash input

**URL:** <https://discuss.elastic.co/t/unable-to-get-postgres-for-logstash-input/96515>\
**Category:** Logstash\
**Created:** [August 9, 2017, 9:21pm UTC](https://discuss.elastic.co/t/unable-to-get-postgres-for-logstash-input/96515 "2017-08-09T21:21:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isra](https://avatars.discourse-cdn.com/v4/letter/i/7ba0ec/32.png) [@Isra](https://discuss.elastic.co/u/Isra)\
**Post date:** [August 9, 2017, 9:21pm UTC](https://discuss.elastic.co/t/unable-to-get-postgres-for-logstash-input/96515/1 "2017-08-09T21:21:12Z")

</div>

I am using the following:  
Logstash 5.5.1  
postgresql-42.1.4.jar  
Java version 1.8.0\_141  
Windows 10

The following is my logstash config file

```
input {
        jdbc {
                jdbc_driver_library => "PATH\TO\postgresql-42.1.4.jar"
                jdbc_driver_class => "org.postgresql.Driver"
                jdbc_connection_string => "jdbc:postgresql://THESERVER:PORT/user=isra"
                jdbc_user => "isra"
                jdbc_password => "123conn"
                statement => "SELECT * from table1"
        }
}

output {
        stdout { codec => json_lines }
}

```

Yet I am getting the following error when attempting to run logstash. Any idea why?

```
 Aug 06, 2017 11:26:31 PM org.postgresql.Driver connect
SEVERE: Connection error:
org.postgresql.util.PSQLException: The connection attempt failed.
        at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:275)
        at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
        at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:194)
        at org.postgresql.Driver.makeConnection(Driver.java:450)
        at org.postgresql.Driver.connect(Driver.java:252)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:481)
        at org.jruby.javasupport.JavaMethod.invokeStaticDirect(JavaMethod.java:373)
        at org.jruby.java.invokers.StaticMethodInvoker.call(StaticMethodInvoker.java:73)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:236)
        at org.jruby.ast.CallSpecialArgNode.interpret(CallSpecialArgNode.java:71)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
```

---

<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 6, 2017, 9:21pm UTC](https://discuss.elastic.co/t/unable-to-get-postgres-for-logstash-input/96515/2 "2017-09-06T21:21:18Z")

</div>

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