# Logstash use environment variable in yml or pipeline conf

**URL:** <https://discuss.elastic.co/t/logstash-use-environment-variable-in-yml-or-pipeline-conf/172990>\
**Category:** Logstash\
**Created:** [March 19, 2019, 2:02pm UTC](https://discuss.elastic.co/t/logstash-use-environment-variable-in-yml-or-pipeline-conf/172990 "2019-03-19T14:02:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hubertn](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@hubertn](https://discuss.elastic.co/u/hubertn)\
**Post date:** [March 19, 2019, 2:02pm UTC](https://discuss.elastic.co/t/logstash-use-environment-variable-in-yml-or-pipeline-conf/172990/1 "2019-03-19T14:02:45Z")

</div>

I have tried to use environment variable in yml and conf file for some reason the variable did not get resolve when i was runnig the pipeline as services. It complained that the variable was not declared. I tried to put the variable in the mypipeline.service but it also did not work. Any help would be apprieciated.

i am using:

/bin/systemctl start mypipeline.service

---

<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 16, 2019, 2:02pm UTC](https://discuss.elastic.co/t/logstash-use-environment-variable-in-yml-or-pipeline-conf/172990/2 "2019-04-16T14:02:48Z")

</div>

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