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


(Michael Zoet) #1

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


(Magnus B├Ąck) #2

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 for how this is implemented.


(Michael Zoet) #3

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 ;-).


(Michael Zoet) #4

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.


(system) #5