# PostgreSQL Extraction with Logstash for Postgresql

**URL:** <https://discuss.elastic.co/t/postgresql-extraction-with-logstash-for-postgresql/357105>\
**Category:** Logstash\
**Created:** [April 9, 2024, 9:18pm UTC](https://discuss.elastic.co/t/postgresql-extraction-with-logstash-for-postgresql/357105 "2024-04-09T21:18:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JOPBI\_Digital](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jopbi_digital/32/133392_2.png) [@JOPBI\_Digital](https://discuss.elastic.co/u/JOPBI_Digital)\
**Post date:** [April 9, 2024, 9:18pm UTC](https://discuss.elastic.co/t/postgresql-extraction-with-logstash-for-postgresql/357105/1 "2024-04-09T21:18:24Z")

</div>

input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:postgresql://db.coa.interno.trans.com.br:7432/trans"  
jdbc\_user =\> "ana"  
jdbc\_password =\> "Hbt"  
jdbc\_driver\_library =\> "/usr/share/logstash/vendor/jar/jdbc/postgresql-42.2.24.jar"  
jdbc\_driver\_class =\> "org.postgresql.Driver"  
schedule =\> "\* \* \* \* \*"  
statement =\> "SELECT oid\_conhecimento, oid\_nota\_fiscal FROM nota\_fiscal\_conhecimento where oid\_nota\_fiscal = 489041"  
tracking\_column =\> "oid\_conhecimento"  
use\_column\_value =\> true  
tracking\_column\_type =\> "numeric"  
last\_run\_metadata\_path =\> "/usr/share/logstash/.logstash\_jdbc\_last\_run"  
}  
}

output {  
jdbc {  
connection\_string =\> "jdbc:postgresql://10.0.0.20:5432/trans\_tms?user=postgres&password=Linc"  
driver\_class =\> "org.postgresql.Driver"  
statement =\> "INSERT INTO nota\_fiscal\_conhecimento (oid\_conhecimento, oid\_nota\_fiscal) VALUES (?, ?)"  
}  
}

is showing the error

Logstash is reporting an error when trying to insert data into a database table using JDBC output. It appears that the error is related to the fact that no value is being specified for parameter 1 in the SQL statement.

[2024-04-09T21:17:00,617][ERROR][logstash.outputs.jdbc][main][41df2148178963aff4526348b707c622dedd50c29a7ea64fb00c58248f4c5fa7] JDBC - Exceção. Não está tentando novamente {:exception=\>#\<Java::OrgPostgresqlUtil::PSQLException: Nenhum valor especificado para o parâmetro 1.\>, :statement=\>"INSERT INTO nota\_fiscal\_conhecimento (oid\_conhecimento, oid\_nota\_fiscal) VALUES (?, ?)", :event=\>"{"@timestamp":"2024-04-09T21:17:00.353381368Z","oid\_nota\_fiscal":489041,"oid\_conhecimento":366304,"@version":"1"}"}

there are some empty columns but I need to record the data anyway, just avoiding duplication

please help me
