# Logstash as a service, how to supply flags?

**URL:** <https://discuss.elastic.co/t/logstash-as-a-service-how-to-supply-flags/50301>\
**Category:** Logstash\
**Created:** [May 18, 2016, 6:05am UTC](https://discuss.elastic.co/t/logstash-as-a-service-how-to-supply-flags/50301 "2016-05-18T06:05:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![YvesC](https://avatars.discourse-cdn.com/v4/letter/y/f6c823/32.png) [@YvesC](https://discuss.elastic.co/u/YvesC)\
**Post date:** [May 18, 2016, 6:05am UTC](https://discuss.elastic.co/t/logstash-as-a-service-how-to-supply-flags/50301/1 "2016-05-18T06:05:28Z")

</div>

Hi all,  
I haven't been working long with logstash but I can't seem to find a solution for the following problem.  
I've set up a docker with log stash (version 2.3), where it runs as a service  
Now I am trying to read an environment variable from linux into my logstash.conf using add\_metadata\_from\_env from the environment plugin.

However for this plugin to accept external environment variables, I've got to set the flag "--allow-env".  
Now my question, where do I set this ? Can I just supply this parameter as I start the logstash service (e.g.: service logstash start --allow-env) ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 18, 2016, 7:44am UTC](https://discuss.elastic.co/t/logstash-as-a-service-how-to-supply-flags/50301/2 "2016-05-18T07:44:46Z")

</div>

Add it to `/etc/defaults/logstash`, for debian based OSs, or `/etc/sysconfig/logstash`, for RHEL based OSs

---

<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:57am UTC](https://discuss.elastic.co/t/logstash-as-a-service-how-to-supply-flags/50301/3 "2017-07-06T04:57:11Z")

</div>

Closed on July 6, 2017, 4:57am UTC


