Postgresql -> Jdbc input plugin -> logstash - ERROR: relation does not exist

Hello everyone,

It seems im missing something, but couldn't found anything related to this. Im using jdbc input plugin to collect some data from postgresql db.

[2021-05-28T03:24:12,032][ERROR][logstash.inputs.jdbc ][main][***********] Java::OrgPostgresqlUtil::PSQLException: ERROR: relation "pg_stat_statements" does not exist Position: 58:
select pu.usename, pss.query, pss.calls, pss.”rows”
from pg_stat_statements pss, pg_user pu
where pss.userid=pu.usesysid
order by 3 desc;

[2021-05-28T03:24:12,109][WARN ][logstash.inputs.jdbc ][main][**********] Exception when executing JDBC query {:exception=>"Java::OrgPostgresqlUtil::PSQLException: ERROR: relation "pg_stat_statements" does not exist\n Position: 58"}

**configuration**
input   {
jdbc    {
jdbc_connection_string => "jdbc:postgresql://database.com:5432/mydatabase"
jdbc_user => "user"
jdbc_password => "password"
jdbc_driver_class => "org.postgresql.Driver"
statement_filepath => "statementpath.sql"
sql_log_level => "warn"
}
}

**statement**
select pu.usename, pss.query, pss.calls, pss.”rows”
from pg_stat_statements pss, pg_user pu
where pss.userid=pu.usesysid
order by 3 desc;

btw; Does this error message come from postgresql or jdbc input plugin does generate it?

fixed this by using "public.pg_stat_statements"

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