# Template file with environment variables?

**URL:** <https://discuss.elastic.co/t/template-file-with-environment-variables/86714>\
**Category:** Elasticsearch\
**Created:** [May 22, 2017, 5:09pm UTC](https://discuss.elastic.co/t/template-file-with-environment-variables/86714 "2017-05-22T17:09:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BDeus](https://avatars.discourse-cdn.com/v4/letter/b/a183cd/32.png) [@BDeus](https://discuss.elastic.co/u/BDeus)\
**Post date:** [May 22, 2017, 5:09pm UTC](https://discuss.elastic.co/t/template-file-with-environment-variables/86714/1 "2017-05-22T17:09:24Z")

</div>

Hello,  
i use lots of beat and logstash in docker and i'm wonder if there are any possibilities to use some environments variables in a template index file.  
Modify index template pattern with an environment variable would be useful.  
Thanks,

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [May 23, 2017, 3:34am UTC](https://discuss.elastic.co/t/template-file-with-environment-variables/86714/2 "2017-05-23T03:34:34Z")

</div>

It is not possible. That would mean the template behavior is dependent on which node the template runs on.

---

<div class="post-metadata">

**Author:** ![BDeus](https://avatars.discourse-cdn.com/v4/letter/b/a183cd/32.png) [@BDeus](https://discuss.elastic.co/u/BDeus)\
**Post date:** [May 23, 2017, 7:46am UTC](https://discuss.elastic.co/t/template-file-with-environment-variables/86714/3 "2017-05-23T07:46:54Z")

</div>

Ok i understand.  
So i will keep my sed command at container runtime 🙂  
Thanks,

---

<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:** [June 20, 2017, 7:47am UTC](https://discuss.elastic.co/t/template-file-with-environment-variables/86714/4 "2017-06-20T07:47:25Z")

</div>

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