# Configuration: how to mix environment variable with static config in a list

**URL:** <https://discuss.elastic.co/t/configuration-how-to-mix-environment-variable-with-static-config-in-a-list/300240>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [March 21, 2022, 6:13pm UTC](https://discuss.elastic.co/t/configuration-how-to-mix-environment-variable-with-static-config-in-a-list/300240 "2022-03-21T18:13:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![grained](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@grained](https://discuss.elastic.co/u/grained)\
**Post date:** [March 21, 2022, 6:13pm UTC](https://discuss.elastic.co/t/configuration-how-to-mix-environment-variable-with-static-config-in-a-list/300240/1 "2022-03-21T18:13:57Z")

</div>

I'm trying to exclude\_files using a mix of environment variables and static configuration but the environment variable seems to be expanded to a list of it's own making it impossible to add to an existing list.

Example:

I have this environment variable  
`DYNAMIC_EXCLUDE='.*exclude1.*','.*exclude2.*'`

I have this configuration  
`exclude_files: ['.*allwaysExclude.*', ${DYNAMIC_EXCLUDE}]`

How do I make the above work???

the environment variable gets converted to a list ending up with a list inside a list.

I can use the environment variable on it's own and it works but I have no way of mixing both.

---

<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 18, 2022, 8:14pm UTC](https://discuss.elastic.co/t/configuration-how-to-mix-environment-variable-with-static-config-in-a-list/300240/2 "2022-04-18T20:14:14Z")

</div>

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