# Logstash - make input file path configurable

**URL:** <https://discuss.elastic.co/t/logstash-make-input-file-path-configurable/32638>\
**Category:** Logstash\
**Created:** [October 21, 2015, 6:24am UTC](https://discuss.elastic.co/t/logstash-make-input-file-path-configurable/32638 "2015-10-21T06:24:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![samnik60](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@samnik60](https://discuss.elastic.co/u/samnik60)\
**Post date:** [October 21, 2015, 6:24am UTC](https://discuss.elastic.co/t/logstash-make-input-file-path-configurable/32638/1 "2015-10-21T06:24:43Z")

</div>

Hi guys,  
Is it possible to pass the input file path from command line like a system variable or environmental variable and use it inside the logstash configuration in some way???

Thanks,  
sam.

---

<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:** [October 21, 2015, 6:29am UTC](https://discuss.elastic.co/t/logstash-make-input-file-path-configurable/32638/2 "2015-10-21T06:29:15Z")

</div>

No, but you can

- generate the Logstash configuration file or
- pass configuration to Logstash via the `-e` startup option.

If you tell us more about what you want to achieve we might be able to give you a better answer.

---

<div class="post-metadata">

**Author:** ![samnik60](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@samnik60](https://discuss.elastic.co/u/samnik60)\
**Post date:** [October 21, 2015, 6:32am UTC](https://discuss.elastic.co/t/logstash-make-input-file-path-configurable/32638/3 "2015-10-21T06:32:25Z")

</div>

Lets assume my logstash configuration to be

input {  
file {  
path =\> "/var/tmp/\*"  
}  
}

i want the ability to pass /var/tmp/\* in some manner say like replacement of a variable

input {  
file {  
path =\> "$TO\_REPLACE"  
}  
}

and pass TO\_REPLACE during start up like logstash -f config.conf -DTO\_REPLACE="/var/tmp/\*"

Thanks,  
sam

---

<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:25am UTC](https://discuss.elastic.co/t/logstash-make-input-file-path-configurable/32638/4 "2017-07-06T05:25:55Z")

</div>


