# Passing command line parameters while starting Logstash

**URL:** https://discuss.elastic.co/t/passing-command-line-parameters-while-starting-logstash/41926
**Category:** Logstash
**Created:** [February 16, 2016, 7:00pm UTC](https://discuss.elastic.co/t/passing-command-line-parameters-while-starting-logstash/41926 "2016-02-16T19:00:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gaurav1424](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@gaurav1424](https://discuss.elastic.co/u/gaurav1424)
#### Post date: [February 16, 2016, 7:00pm UTC](https://discuss.elastic.co/t/passing-command-line-parameters-while-starting-logstash/41926/1 "2016-02-16T19:00:28Z")

</div>

Hello All,

Is there any was to pass command line arguments while starting logstash ?  
Current what I do :

I start logstash as -\> bin/logstash -f and in config file the parameters which are region specific I add as Hard coded (using add\_field option)

What I want :

something like this  
bin/logstash -f -region = AMER Data\_center = LAX  
bin/logstash -f -region = AMER Data\_center = CHI  
bin/logstash -f -region = EMEA Data\_center = LON

Something like this.

Thanks,  
Gaurav

---

<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: [February 16, 2016, 9:34pm UTC](https://discuss.elastic.co/t/passing-command-line-parameters-while-starting-logstash/41926/2 "2016-02-16T21:34:07Z")

</div>

Have you looked at the environment filter? You're not saying what you want to accomplish so it's hard to help out.

---

<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, 5:11am UTC](https://discuss.elastic.co/t/passing-command-line-parameters-while-starting-logstash/41926/3 "2017-07-06T05:11:07Z")

</div>


