# How to pass command line arguments to logsatsh

**URL:** https://discuss.elastic.co/t/how-to-pass-command-line-arguments-to-logsatsh/46924
**Category:** Logstash
**Created:** [April 10, 2016, 9:56pm UTC](https://discuss.elastic.co/t/how-to-pass-command-line-arguments-to-logsatsh/46924 "2016-04-10T21:56:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sdaruna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sdaruna/32/7289_2.png) [@sdaruna](https://discuss.elastic.co/u/sdaruna)
#### Post date: [April 10, 2016, 9:56pm UTC](https://discuss.elastic.co/t/how-to-pass-command-line-arguments-to-logsatsh/46924/1 "2016-04-10T21:56:41Z")

</div>

Can we pass command line arguments to logstash.?

I am sending the output from logstash to redis server. I would like to use command line arguments to pass the redis host.

How can we pass command line arguments to logstash and use them in script.?

---

<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: [April 11, 2016, 5:47am UTC](https://discuss.elastic.co/t/how-to-pass-command-line-arguments-to-logsatsh/46924/2 "2016-04-11T05:47:31Z")

</div>

No, but in recent versions of Logstash you can reference environment variables in the configuration files.

---

<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:03am UTC](https://discuss.elastic.co/t/how-to-pass-command-line-arguments-to-logsatsh/46924/3 "2017-07-06T05:03:00Z")

</div>


