Using jdbc in logstash to import Elasticsearch data Connection error

Hi all,

I'm trying to import data from different databases from different clusters to my elasticsearch database.

Before importing mysql data to my elasticsearch database , I'm trying to import elasticsearch database from another cluster to my local database elasticsearch.

Below configuration file of my jdbc.conf that I'm running using logstash:

input {  
jdbc {

jdbc_connection_string => "jdbc:elasticsearch://login:pwd@ccc.ddd.com:9200;database=eee_*;encrypt=false"

# The user you want to execute your statement as
jdbc_user => "elasticsearch"
# The path to your downloaded jdbc driver
jdbc_driver_library => "/etc/logstash-8.4.0/logstash-core/lib/jars/x-pack-sql-jdbc-8.4.0"
# The name of the driver class
jdbc_driver_class => "org.elasticsearch.jdbc.Driver"
# Query for testing purpose
statement => "SELECT * from eee_*"
}
}
output {  
elasticsearch {
 hosts => ["xxx.xx.xx.xx:9200"]
 index =>  "test_jdbc"
 }
stdout { codec => rubydebug }
   }

After setting up this jdbc.conf file, I run below logstash command:
sudo bin/logstash -f config/jdbc.conf

It runs in terminal but it gives below error:

Outputs::Elasticsearch::HttpClient::Pool::HostUnreachableError, :message=>”Elasticsear ch Unreachable:

I've checked logs, it shows same error.
I'm not able to get the error in my conf file.

This means that your logstash can not connect to the Elasticsearch configured in the output block.

You need to check if the Elasticsearch is running and if the Logstash machina can access it.

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