# Getting environment variables as array

**URL:** https://discuss.elastic.co/t/getting-environment-variables-as-array/53468
**Category:** Logstash
**Created:** [June 21, 2016, 8:53am UTC](https://discuss.elastic.co/t/getting-environment-variables-as-array/53468 "2016-06-21T08:53:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Raul\_Uria](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@Raul\_Uria](https://discuss.elastic.co/u/Raul_Uria)
#### Post date: [June 21, 2016, 8:53am UTC](https://discuss.elastic.co/t/getting-environment-variables-as-array/53468/1 "2016-06-21T08:53:22Z")

</div>

Hi, I´m trying to set PATH in file input plugin from env variables, but doesn´t seem to work.

I run a "complex" logic to set files that I want to process with logstash before execute it, so I set a env variable with paths, PATHS="file1", "file2"...

In logstash conf

input {  
file {  
...  
PATH =\> ["${PATHS}"]  
...

but, "File paths must be absolute, relative path specified" error raises. I know PATH=\>["${file1}","${file2}"] works, but I don´t know how many files i´ll use in advance, so this is not a solution in my case.

Is it possible to pass in an array (as array or as string) to logstash conf vía env. variables?

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [June 21, 2016, 8:57am UTC](https://discuss.elastic.co/t/getting-environment-variables-as-array/53468/2 "2016-06-21T08:57:32Z")

</div>

> Is it possible to pass in an array (as array or as string) to logstash conf vía env. variables?

Most likely not. Perhaps you can generate the Logstash configuration file or supply the files via the command line?

```
logstash -e 'input { file { path => [...] } }' -f other-config.conf

```

---

<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: [July 6, 2017, 4:51am UTC](https://discuss.elastic.co/t/getting-environment-variables-as-array/53468/3 "2017-07-06T04:51:33Z")

</div>


