# Logstash env configuration to set the elastic search url

**URL:** https://discuss.elastic.co/t/logstash-env-configuration-to-set-the-elastic-search-url/250675
**Category:** Logstash
**Tags:** docker
**Created:** [October 1, 2020, 12:33pm UTC](https://discuss.elastic.co/t/logstash-env-configuration-to-set-the-elastic-search-url/250675 "2020-10-01T12:33:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![masber](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/masber/32/76424_2.png) [@masber](https://discuss.elastic.co/u/masber)
#### Post date: [October 1, 2020, 12:33pm UTC](https://discuss.elastic.co/t/logstash-env-configuration-to-set-the-elastic-search-url/250675/1 "2020-10-01T12:33:49Z")

</div>

Hi, I am running logstash docker container and need to know which env to use to tell logstash where to find the elasticsearch server.

`[2020-10-01T11:37:39,829][WARN][logstash.licensechecker.licensereader] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://elasticsearch:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch: Name or service not known"}`

any thoughts?

---

<div class="post-metadata">

### Author: ![masber](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/masber/32/76424_2.png) [@masber](https://discuss.elastic.co/u/masber)
#### Post date: [October 1, 2020, 2:08pm UTC](https://discuss.elastic.co/t/logstash-env-configuration-to-set-the-elastic-search-url/250675/3 "2020-10-01T14:08:35Z")

</div>

I want to change the value [http://elasticsearch:9200](http://elasticsearch:9200) to a different value using an env instead of a configuration file.

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [October 1, 2020, 2:24pm UTC](https://discuss.elastic.co/t/logstash-env-configuration-to-set-the-elastic-search-url/250675/5 "2020-10-01T14:24:39Z")

</div>

> [@masber](#):
>
> I want to change the value [http://elasticsearch:9200](http://elasticsearch:9200) to a different value using an env instead of a configuration file.

If it were an elasticsearch output then you could [do that](https://www.elastic.co/guide/en/logstash/current/environment-variables.html), but I believe the licence check always uses a value from logstash.yml

---

<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: [October 29, 2020, 2:24pm UTC](https://discuss.elastic.co/t/logstash-env-configuration-to-set-the-elastic-search-url/250675/6 "2020-10-29T14:24:54Z")

</div>

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