Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify Schema Name in Logstash config input for postgreSQL? #377

Open
yash-bhardwaj opened this issue Mar 4, 2020 · 3 comments
Open

Comments

@yash-bhardwaj
Copy link

yash-bhardwaj commented Mar 4, 2020

For below config:

{
input {
    jdbc {
	jdbc_validate_connection => true
        jdbc_connection_string => "jdbc:postgresql://127.0.0.1:5433/Wallet_DB"
	jdbc_user => "postgres"
	jdbc_password => "postgres"
	jdbc_driver_library => "D:/softwares/logstash-7.6.0/logstash-core/lib/jars/jdbc-postgresql.jar"
	jdbc_driver_class => "org.postgresql.Driver"
	statement => "SELECT * FROM schema.customer_wallet_details"
    }
}

I'm Getting Error:

[ERROR][logstash.inputs.jdbc     ][main] Java::OrgPostgresqlUtil::PSQLException: ERROR: relation "schema.customer_wallet_details" does not exist: SELECT * FROM schema.customer_wallet_details
[WARN ][logstash.inputs.jdbc     ][main] Exception when executing JDBC query {:exception=>#<Sequel::DatabaseError: Java::OrgPostgresqlUtil::PSQLException: ERROR: relation "schema.customer_wallet_details" does not exist>}

I saw an example sql for the same in documentation, but it simply doesn't work.

@elasticsearch-bot please guide

@luishenriqueamaral
Copy link

It doesn't really work. Even setting the parameter, I believe that the public scheme is always used.

@jacksparrow414
Copy link

Use the currentSchema parameter

jdbc_connection_string => "jdbc:postgresql://127.0.0.1:5433/Wallet_DB?currentSchema=yourschemaname"

refs:
https://jdbc.postgresql.org/documentation/use/#connection-parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants