# Populating pipeline env variable with array of values

**URL:** https://discuss.elastic.co/t/populating-pipeline-env-variable-with-array-of-values/203052
**Category:** Logstash
**Created:** [October 10, 2019, 2:49pm UTC](https://discuss.elastic.co/t/populating-pipeline-env-variable-with-array-of-values/203052 "2019-10-10T14:49:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Merlin\_Nunez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/merlin_nunez/32/58551_2.png) [@Merlin\_Nunez](https://discuss.elastic.co/u/Merlin_Nunez)
#### Post date: [October 10, 2019, 2:49pm UTC](https://discuss.elastic.co/t/populating-pipeline-env-variable-with-array-of-values/203052/1 "2019-10-10T14:49:46Z")

</div>

Hi All,

I´m trying to move from a single note cluster to the following configuration, esentially adding two ES notes for redundancy.  
es1, es2, es3,  
Kibana  
Logstash  
Multiple filebeats

I have successfully configured kibana to receive via env variable all three ES urls so it can continue working even if one ES is lost.

My issue is now with logstash, currently I have a single pipeline set up, that before now, pointed to ES like this:

> hosts =\> ["${ELASTICSEARCH\_HOSTS}"]

And I would later pass the value via compose or marathon using an environmental variable like:

> "ELASTICSEARCH\_HOSTS": "[http://xxxxx.x.x:9200](http://xxxxx.x.x:9200)",

I now want to configure logstash to be able to continue pushing logs even if one ES instance is lost.

I tried everything but it wont work, if I set the pipeline directly like this:

> hosts =\> ["[http://xxxxx.x.1:9200](http://xxxxx.x.1:9200)", "[http://xxxxx.x.2:9200](http://xxxxx.x.2:9200)", "[http://xxxxx.x.3:9200](http://xxxxx.x.3:9200)" ]

It works just fine, but I tried for example:

> hosts =\> "${ELASTICSEARCH\_HOSTS}"

And passing:

> "ELASTICSEARCH\_HOSTS": "["[http://xxxxx.x.1:9200](http://xxxxx.x.1:9200)", "[http://xxxxx.x.2:9200](http://xxxxx.x.2:9200)", "[http://xxxxx.x.3:9200](http://xxxxx.x.3:9200)" ]",

Or

> hosts =\> ["${ELASTICSEARCH\_HOSTS}"]

And passing:

> "ELASTICSEARCH\_HOSTS": " "[http://xxxxx.x.1:9200](http://xxxxx.x.1:9200)", "[http://xxxxx.x.2:9200](http://xxxxx.x.2:9200)", "[http://xxxxx.x.3:9200](http://xxxxx.x.3:9200)" ",

And I always get the same error:

> "Illegal character in authority at index 7: [http://xxxxx.x.1:9200](http://xxxxx.x.1:9200)", "[http://xxxxx.x.2:9200](http://xxxxx.x.2:9200)", "[http://xxxxx.x.3:9200](http://xxxxx.x.3:9200)"

I´ve look around on line and can´t find anything specific about being able to pass arrays in env variables, so IDK if this is possible at all.

Thanks in advance,

Regards,

---

<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 10, 2019, 4:05pm UTC](https://discuss.elastic.co/t/populating-pipeline-env-variable-with-array-of-values/203052/2 "2019-10-10T16:05:53Z")

</div>

> [@Merlin\_Nunez](#):
>
> pass arrays in env variables

That does [not](https://discuss.elastic.co/t/exception-java-urisyntaxexception-message-illegal-character-in-path-at-index-0-esi1-esi2/165456/4) work.

---

<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: [November 7, 2019, 4:07pm UTC](https://discuss.elastic.co/t/populating-pipeline-env-variable-with-array-of-values/203052/3 "2019-11-07T16:07:57Z")

</div>

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