postgresqlelasticsearchlogstashlogstash-configurationlogstash-file

cant config logstash to postgres


im not able to config my logstash-2.3.2 with my postgresql-9.5.4-1-windows-x64. here's is my log-config.conf file

    input {
    jdbc {
        # Postgres jdbc connection string to our database, mydb
        jdbc_connection_string => "jdbc:postgresql://localhost:5432/ambule"
        # The user we wish to execute our statement as
        jdbc_user => "postgres"
        # The path to our downloaded jdbc driver
        jdbc_driver_library => "C:\Users\Administrator\Downloads\postgresql-9.4-1201-jdbc41.jar"
        # The name of the driver class for Postgresql
        jdbc_driver_class => "org.postgresql.Driver"
        # our query
        statement => "SELECT * from table1"
    }
}
output {
    stdout { codec => json_lines }
}

im getting error


Solution

  • I guess the exception itself lies within the jdbc_connection_string. What if you have it as such:

    jdbc_connection_string => "jdbc:postgresql://host:port/database?user=username"
    

    ----------------------------------------------------------------------------------------^ try adding the user

    Seems like it has been missed out from the doc. Hope it helps!