it's the first time I'm trying to access a postgresql database through logstash. however there are dnado errors, can you help me. Below is conf and error.
input{
jdbc{
jdbc_driver_library => "/usr/share/java/postgresql-jdbc.jar"
jdbc_driver_class => "org.postgresql.Driver"
jdbc_connection_string => "jdbc:postgresql://x.x.x.x:5432/banco"
jdbc_user => " x"
jdbc_password => "y"
statement => "
############ QUERY MYSQL
select
*
FROM
events e
WHERE
LIMIT
1
"
}
}
filter{
}
output{
stdout {
codec => rubydebug
}
}
error:
´
[ERROR] 2022-03-03 14:25:06.697 [[main]<jdbc] jdbc - Unable to connect to database. Tried 1 times {:error_message=>"Java::OrgPostgresqlUtil::PSQLException: FATAL: no pg_hba.conf entry for host "X", user " X", database "X", SSL off"}
[ERROR] 2022-03-03 14:25:06.699 [[main]<jdbc] javapipeline - A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::Jdbc jdbc_user=>" lanlink", jdbc_password=>, statement=>"\n############ QUERY MYSQL\nselect DISTINCT\n-- prodllkzabixauto ZXCVB\n*\n\nFROM\n events e \nWHERE\n LIMIT\n 1 \n\n", jdbc_driver_library=>"/usr/share/java/postgresql-jdbc.jar", jdbc_connection_string=>"jdbc:postgresql://X:5432/zabbix", id=>"f408664b97db17798e1c8aaac60a281e0afb717bd864fa1127a1c071ae1efd23", jdbc_driver_class=>"org.postgresql.Driver", type=>"X", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_c2a8d638-fb93-4309-b447-54a86b75d3eb", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, plugin_timezone=>"utc", last_run_metadata_path=>"/root/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true, use_prepared_statements=>false>
Error: Java::OrgPostgresqlUtil::PSQLException: FATAL: no pg_hba.conf entry for host "X", user " lanlink", database "zabbix", SSL off
Exception: Sequel::DatabaseConnectionError
Stack: org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(org/postgresql/core/v3/ConnectionFactoryImpl.java:398)
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(org/postgresql/core/v3/ConnectionFactoryImpl.java:173)
org.postgresql.core.ConnectionFactory.openConnection(org/postgresql/core/ConnectionFactory.java:64)
org.postgresql.jdbc2.AbstractJdbc2Connection.(org/postgresql/jdbc2/AbstractJdbc2Connection.java:136)
org.postgresql.jdbc3.AbstractJdbc3Connection.(org/postgresql/jdbc3/AbstractJdbc3Connection.java:29)
org.postgresql.jdbc3g.AbstractJdbc3gConnection.(org/postgresql/jdbc3g/AbstractJdbc3gConnection.java:21)
org.postgresql.jdbc4.AbstractJdbc4Connection.(org/postgresql/jdbc4/AbstractJdbc4Connection.java:31)
org.postgresql.jdbc4.Jdbc4Connection.(org/postgresql/jdbc4/Jdbc4Connection.java:34)
org.postgresql.Driver.makeConnection(org/postgresql/Driver.java:393)
org.postgresql.Driver.connect(org/postgresql/Driver.java:267)
jdk.internal.reflect.GeneratedMethodAccessor22.invoke(jdk/internal/reflect/GeneratedMethodAccessor22)
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(jdk/internal/reflect/DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:566)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:471)
org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:329)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_39_dot_0.lib.sequel.adapters.jdbc.connect(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.39.0/lib/sequel/adapters/jdbc.rb:239)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_39_dot_0.lib.sequel.connection_pool.make_new(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.39.0/lib/sequel/connection_pool.rb:122)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_39_dot_0.lib.sequel.connection_pool.threaded.assign_connection(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.39.0/lib/sequel/connection_pool/threaded.rb:209)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_39_dot_0.lib.sequel.connection_pool.threaded.acquire(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.39.0/lib/sequel/connection_pool/threaded.rb:139)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_39_dot_0.lib.sequel.connection_pool.threaded.hold(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.39.0/lib/sequel/connection_pool/threaded.rb:91)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_39_dot_0.lib.sequel.database.connecting.synchronize(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.39.0/lib/sequel/database/connecting.rb:269)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_39_dot_0.lib.sequel.database.connecting.test_connection(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.39.0/lib/sequel/database/connecting.rb:278)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_39_dot_0.lib.sequel.database.misc.initialize(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.39.0/lib/sequel/database/misc.rb:169)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_39_dot_0.lib.sequel.database.connecting.connect(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.39.0/lib/sequel/database/connecting.rb:57)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_39_dot_0.lib.sequel.core.connect(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.39.0/lib/sequel/core.rb:124)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_integration_minus_jdbc_minus_5_dot_0_dot_6.lib.logstash.plugin_mixins.jdbc.jdbc.jdbc_connect(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.6/lib/logstash/plugin_mixins/jdbc/jdbc.rb:114)
org.jruby.RubyKernel.loop(org/jruby/RubyKernel.java:1442)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_integration_minus_jdbc_minus_5_dot_0_dot_6.lib.logstash.plugin_mixins.jdbc.jdbc.jdbc_connect(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.6/lib/logstash/plugin_mixins/jdbc/jdbc.rb:111)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_integration_minus_jdbc_minus_5_dot_0_dot_6.lib.logstash.plugin_mixins.jdbc.jdbc.open_jdbc_connection(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.6/lib/logstash/plugin_mixins/jdbc/jdbc.rb:139)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_integration_minus_jdbc_minus_5_dot_0_dot_6.lib.logstash.plugin_mixins.jdbc.jdbc.execute_statement(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.6/lib/logstash/plugin_mixins/jdbc/jdbc.rb:197)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_integration_minus_jdbc_minus_5_dot_0_dot_6.lib.logstash.inputs.jdbc.execute_query(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.6/lib/logstash/inputs/jdbc.rb:316)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_integration_minus_jdbc_minus_5_dot_0_dot_6.lib.logstash.inputs.jdbc.run(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.6/lib/logstash/inputs/jdbc.rb:284)
usr.share.logstash.logstash_minus_core.lib.logstash.java_pipeline.inputworker(/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:405)
usr.share.logstash.logstash_minus_core.lib.logstash.java_pipeline.RUBY$method$inputworker$0$VARARGS(usr/share/logstash/logstash_minus_core/lib/logstash//usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb)
usr.share.logstash.logstash_minus_core.lib.logstash.java_pipeline.start_input(/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:396)
org.jruby.RubyProc.call(org/jruby/RubyProc.java:318)
java.lang.Thread.run(java/lang/Thread.java:834)