# Can a conf string be passed into logstash instead of a file location?

**URL:** https://discuss.elastic.co/t/can-a-conf-string-be-passed-into-logstash-instead-of-a-file-location/177632
**Category:** Logstash
**Created:** [April 19, 2019, 2:11pm UTC](https://discuss.elastic.co/t/can-a-conf-string-be-passed-into-logstash-instead-of-a-file-location/177632 "2019-04-19T14:11:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![snowboardcto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/snowboardcto/32/44466_2.png) [@snowboardcto](https://discuss.elastic.co/u/snowboardcto)
#### Post date: [April 19, 2019, 2:12pm UTC](https://discuss.elastic.co/t/can-a-conf-string-be-passed-into-logstash-instead-of-a-file-location/177632/1 "2019-04-19T14:12:00Z")

</div>

Can a string be passed into logstash that represents a conf file? I'd like to dynamically create a conf on demand. I know we can bin/logstash -f test.conf, but I'd like to know if we can pass in a string instead of referencing a file location. Thanks!

Something like:

bin/logstash -f "input { stdin { } } output { stdout { } }"

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [April 19, 2019, 3:48pm UTC](https://discuss.elastic.co/t/can-a-conf-string-be-passed-into-logstash-instead-of-a-file-location/177632/2 "2019-04-19T15:48:04Z")

</div>

Instead of -f, use -e or --config.string to pass a string containing the configuration to logstash.

---

<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: [May 17, 2019, 3:48pm UTC](https://discuss.elastic.co/t/can-a-conf-string-be-passed-into-logstash-instead-of-a-file-location/177632/3 "2019-05-17T15:48:04Z")

</div>

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