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

**URL:** https://discuss.elastic.co/t/logstash-outputs-elasticsearch-uri-is-not-valid-host-is-not-specified/222664
**Category:** Logstash
**Tags:** docker
**Created:** [March 9, 2020, 8:13am UTC](https://discuss.elastic.co/t/logstash-outputs-elasticsearch-uri-is-not-valid-host-is-not-specified/222664 "2020-03-09T08:13:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Austin\_Lai](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/austin_lai/32/64056_2.png) [@Austin\_Lai](https://discuss.elastic.co/u/Austin_Lai)
#### Post date: [March 9, 2020, 8:13am UTC](https://discuss.elastic.co/t/logstash-outputs-elasticsearch-uri-is-not-valid-host-is-not-specified/222664/1 "2020-03-09T08:13:01Z")

</div>

# 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](http://elasticsearch7.6.1:9200/?fbclid=IwAR1njXoxFGuBv-LCDE1kCsalPUQSCUgQZiHjieki2BcfyZWvJIbvxK_rM8U)"]  
> 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](http://172.19.0.2:9200/?fbclid=IwAR1jPvb70uju6yCaxjalkC3k_rXZ0xODoUr5lU64vkqhocKP4uG-ylGdN3w)"] 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

---

<div class="post-metadata">

### Author: ![mingderwang1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mingderwang1/32/62495_2.png) [@mingderwang1](https://discuss.elastic.co/u/mingderwang1)
#### Post date: [March 9, 2020, 2:16pm UTC](https://discuss.elastic.co/t/logstash-outputs-elasticsearch-uri-is-not-valid-host-is-not-specified/222664/2 "2020-03-09T14:16:33Z")

</div>

> [@Austin\_Lai](#):
>
> elasticsearch7.6.1-docker-host:9200

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

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 6, 2020, 2:16pm UTC](https://discuss.elastic.co/t/logstash-outputs-elasticsearch-uri-is-not-valid-host-is-not-specified/222664/3 "2020-04-06T14:16:43Z")

</div>

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