Logstash unable to reach Elasticsearch

piyush_hn
Wed, 10 Sep 2025 18:27:51 +0000
Logstash

Hi All,

I am new to elastic stack and set it up on two instances on AWS. My main objective of this demonstration is to show that we can forward the application/machine logs to kibana dashboard.

1. One EC2 instance is running two docker containers one each for Elasticsearch & Kibana. Both containers are connected to each other which I had verified.

2. Another EC2 instance is running Logstash container. I have one application which is constantly generating logs on this host. Note that this application is not running inside any container.

Basically my logstash.conf looks something like below.

input {
file {
path => "/var/log/logify/app.log"
start_position => "beginning"
}
}
filter {
if [message] =~ /^{.}$/ {
json {
source => "message"
}
}
mutate {
remove_field => ["event", "message", "emailAddress"]
add_field => { "env" => "development" }
}
}
output {
elasticsearch {
hosts => ["https://:9200"]
index => "my-index"
ssl_verification_mode => "none"
user=> "elastic"
password=> "1tA0JWcRNL0d*lE9S4Kh"
}
}

Even though the Elasticsearch configuration looks okay but it shows below error. It says Elasticsearch host not reachable by logstash, can anyone please guide ?

[2025-09-10T18:19:54,694][ERROR][logstash.licensechecker.licensereader] Unable to retrieve Elasticsearch cluster info. {:message=>"No Available connections", :exception=>LogStash::Outputs::Elasticsearch::HttpClient::Pool::NoConnectionAvailableError}
[2025-09-10T18:19:54,695][ERROR][logstash.licensechecker.licensereader] Unable to retrieve license information from license server {:message=>"No Available connections"}
[2025-09-10T18:20:24,695][ERROR][logstash.licensechecker.licensereader] Unable to retrieve Elasticsearch cluster info. {:message=>"No Available connections", :exception=>LogStash::Outputs::Elasticsearch::HttpClient::Pool::NoConnectionAvailableError}
[2025-09-10T18:20:24,695][ERROR][logstash.licensechecker.licensereader] Unable to retrieve license information from license server {:message=>"No Available connections"}
[2025-09-10T18:20:24,703][INFO ][logstash.licensechecker.licensereader] Failed to perform request {:message=>"elasticsearch: Name or service not known", :exception=>Manticore::ResolutionFailure, :cause=>#<Java::JavaNet::UnknownHostException: elasticsearch: Name or service not known>}
[2025-09-10T18:20:24,703][WARN ][logstash.licensechecker.licensereader] Attempted to resurrect connection to dead ES instance, but got an error {:url=>"http://elasticsearch:9200/", :exception=>LogStash::Outputs::Elasticsearch::HttpClient::Pool::HostUnreachableError, :message=>"Elasticsearch Unreachable: [http://elasticsearch:9200/\\][Manticore::ResolutionFailure] elasticsearch: Name or service not known"}
[2025-09-10T18:20:54,694][ERROR][logstash.licensechecker.licensereader] Unable to retrieve Elasticsearch cluster info. {:message=>"No Available connections", :exception=>LogStash::Outputs::Elasticsearch::HttpClient::Pool::NoConnectionAvailableError}
[2025-09-10T18:20:54,697][ERROR][logstash.licensechecker.licensereader] Unable to retrieve license information from license server {:message=>"No Available connections"}
[2025-09-10T18:20:54,719][INFO ][logstash.licensechecker.licensereader] Failed to perform request {:message=>"elasticsearch: Name or service not known", :exception=>Manticore::ResolutionFailure, :cause=>#<Java::JavaNet::UnknownHostException: elasticsearch: Name or service not known>}
[2025-09-10T18:20:54,719][WARN ][logstash.licensechecker.licensereader] Attempted to resurrect connection to dead ES instance, but got an error {:url=>"http://elasticsearch:9200/", :exception=>LogStash::Outputs::Elasticsearch::HttpClient::Pool::HostUnreachableError, :message=>"Elasticsearch Unreachable: [http://elasticsearch:9200/\\][Manticore::ResolutionFailure] elasticsearch: Name or service not known"}

6 posts - 2 participants