# Is it possible to create configuration snippet for the logstash-forwarder in a directory?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-create-configuration-snippet-for-the-logstash-forwarder-in-a-directory/27309>\
**Category:** Logstash\
**Created:** [August 13, 2015, 8:30am UTC](https://discuss.elastic.co/t/is-it-possible-to-create-configuration-snippet-for-the-logstash-forwarder-in-a-directory/27309 "2015-08-13T08:30:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelzoet](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@michaelzoet](https://discuss.elastic.co/u/michaelzoet)\
**Post date:** [August 13, 2015, 8:30am UTC](https://discuss.elastic.co/t/is-it-possible-to-create-configuration-snippet-for-the-logstash-forwarder-in-a-directory/27309/1 "2015-08-13T08:30:08Z")

</div>

Hello all,

I want/need to create logstash-forwarder configuration snippets based on which Puppet profile a server uses. For example a server that runs Apache and PostgreSQL should have entries in /etc/logstash-forwarder/conf.d/ likes this

010-forwarder\_network\_setup.conf  
020-forwarder\_syslog\_aggregation.conf  
030-forwarder\_apache\_aggergation.conf  
040-forwarder\_postgresql\_aggregation.conf

If this is possible how need the JSON content be structured?

Thx in advance,  
Michael

---

<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:** [August 13, 2015, 8:53am UTC](https://discuss.elastic.co/t/is-it-possible-to-create-configuration-snippet-for-the-logstash-forwarder-in-a-directory/27309/2 "2015-08-13T08:53:19Z")

</div>

Yes, this is possible. The contents of the "files" sections will be concatenated to a single list, likewise with the list of server names. Non-list configuration keys like SSL configuration values can't exist in more than one place. See [config.go:45](https://github.com/elastic/logstash-forwarder/blob/v0.4.0/config.go#L65) for how this is implemented.

---

<div class="post-metadata">

**Author:** ![michaelzoet](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@michaelzoet](https://discuss.elastic.co/u/michaelzoet)\
**Post date:** [August 13, 2015, 1:17pm UTC](https://discuss.elastic.co/t/is-it-possible-to-create-configuration-snippet-for-the-logstash-forwarder-in-a-directory/27309/3 "2015-08-13T13:17:00Z")

</div>

THX for the answer. I will look into the code and try to understand it. But I am not a developer or have any experience with Go. I am just a DevOps with the emphasis on Ops ;-).

---

<div class="post-metadata">

**Author:** ![michaelzoet](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@michaelzoet](https://discuss.elastic.co/u/michaelzoet)\
**Post date:** [August 14, 2015, 1:04pm UTC](https://discuss.elastic.co/t/is-it-possible-to-create-configuration-snippet-for-the-logstash-forwarder-in-a-directory/27309/4 "2015-08-14T13:04:33Z")

</div>

I have setup something that works. If someone else stumbles over this: you only need to create valid JSON configuration snippets in the configuration directory and the logstash-forwarder takes care of the rest if started with the -config option pointing to this directory.

THX for the help.

---

<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:31am UTC](https://discuss.elastic.co/t/is-it-possible-to-create-configuration-snippet-for-the-logstash-forwarder-in-a-directory/27309/5 "2017-07-06T05:31:57Z")

</div>

Closed on July 6, 2017, 5:31am UTC


