LogStash-Outputs -ElasticSearch - URI is not valid - host is not specified

Anyone solved the issue of below error message??

logstash7.6.1 | [2020-03-08T06:49:05,409][DEBUG][logstash.plugins.registry] On demand adding plugin to the registry {:name=>"elasticsearch", :type=>"output", :class=>LogStash::Outputs::Elasticsearch}
logstash7.6.1 | [2020-03-08T06:49:05,490][FATAL][logstash.runner ] The given configuration is invalid. Reason: Unable to configure plugins: (ArgumentError) URI is not valid - host is not specified
logstash7.6.1 | [2020-03-08T06:49:05,514][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

Using hostname in output elasticsearch - logstash not working
================================
output {
stdout { codec => rubydebug }
elasticsearch {
hosts => ["http://elasticsearch7.6.1:9200"]
sniffing => true
manage_template => false
index => ["%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"]
document_type => ["%{[@metadata][type]}"]
}
}

OR

output {
stdout { codec => rubydebug }
elasticsearch {
hosts => ["elasticsearch7.6.1:9200"]
sniffing => true
manage_template => false
index => ["%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"]
document_type => ["%{[@metadata][type]}"]
}
}

OR

output {
stdout { codec => rubydebug }
elasticsearch {
hosts => ["elasticsearch7.6.1-docker-host:9200"]
sniffing => true
manage_template => false
index => ["%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"]
document_type => ["%{[@metadata][type]}"]
}
}

But using IP in output elasticsearch - logstash working fine
=============

output {
stdout { codec => rubydebug }
elasticsearch {
hosts => ["http://172.19.0.2:9200"]
sniffing => true
manage_template => false
index => ["%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"]
document_type => ["%{[@metadata][type]}"]
}
}

My kibana got no issue to connect to elasticsearch using hostname
Docker environment

1 Like

replace the hostname without using DOT, resolved the problem. We figure it out from the source code.

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