Relation input jdbc POSTGRES logstash

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.

e Elastic Common Schema. Once ECS v8 and an updated release of this plugin are publicly available, you will need to update this plugin to resolve this warning.
[2022-07-23T17:11:16,579][INFO ][logstash.outputs.elasticsearch][main] Using a default mapping template {:es_version=>8, :ecs_compatibility=>:v8}
[2022-07-23T17:11:16,757][INFO ][logstash.javapipeline ][main] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>500, "pipeline.sources"=>["C:/Users/Lenovo/Desktop/ELK/logstash-8.1.0/conf.conf"], :thread=>"#<Thread:0x632a9cab run>"}
[2022-07-23T17:11:18,734][INFO ][logstash.javapipeline ][main] Pipeline Java execution initialization time {"seconds"=>1.96}
[2022-07-23T17:11:18,894][INFO ][logstash.inputs.jdbc ][main] ECS compatibility is enabled but target option was not specified. This may cause fields to be set at the top-level of the event where they are likely to clash with the Elastic Common Schema. It is recommended to set the target option to avoid potential schema conflicts (if your data is ECS compliant or non-conflicting, feel free to ignore this message)
[2022-07-23T17:11:18,907][INFO ][logstash.javapipeline ][main] Pipeline started {"pipeline.id"=>"main"}
[2022-07-23T17:11:19,031][INFO ][logstash.agent ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>}
[2022-07-23T17:11:21,316][ERROR][logstash.inputs.jdbc ][main][93b8511000ea072a746d99b5947f6736afe05497184ca33530a422de49011599] Java::OrgPostgresqlUtil::PSQLException: ERREUR: erreur de syntaxe sur ou près de « - »
Position : 23: SELECT * FROM PUBLIC.Consommation
[2022-07-23T17:11:21,463][WARN ][logstash.inputs.jdbc ][main][93b8511000ea072a746d99b5947f6736afe05497184ca33530a422de49011599] Exception when executing JDBC query {:exception=>Sequel::DatabaseError, :message=>"Java::OrgPostgresqlUtil::PSQLException: ERREUR: erreur de syntaxe sur ou près de « - »\n Position : 23", :cause=>"org.postgresql.util.PSQLException: ERREUR: erreur de syntaxe sur ou près de « - »\n Position : 23"}
my file conf like this:`

input {
    jdbc {
jdbc_driver_library => "C:\Users\Lenovo\Desktop\ELK\logstash-8.1.0\logstash-core\lib\jars\postgresql-42.4.0.jar"
jdbc_driver_class => "org.postgresql.Driver"
  jdbc_connection_string => "jdbc:postgresql://localhost:5432/nameDB"
        jdbc_user => "postgres"
        jdbc_password => ""
        #schedule => " * * * * *" 
        statement => "SELECT * FROM PUBLIC.Consommation"
   # tracking_column => "ID_P"
 #tracking_column_type => "numeric"
#record_last_run => true
#clean_run => true
   # jdbc_fetch_size => 10
    }
}

output {
  elasticsearch {
        hosts => ["http://localhost:9200"]
        index => "20190904test-%{+YYYY.DD.dd}"
       user => "el"
       password => "r"
}
}
any suggestion,?

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