How do you store variables for logstash?

There are a few things that I am doing in logstash for which I would like to store variables in a file that is separate from the logstash filter configs themselves. For example, I am using the CIDR filter in a few different environments. Each one of them has different CIDR blocks and tags that I want to apply.

Is there some way that I can store the CIDR blocks and tags somewhere other than within the logstash filter file itself? I want to avoid having to edit my core logstash filters in each environment.

Has anyone done something like this? Or should I just use templates (ansible, etc.) to generate the appropriate code in my logstash files?

I'd say generate your configuration files. That said, there is an open pull request for the cidr filter that adds the possibility to load network patterns from a file. I'll review it tomorrow so it might be released fairly soon.

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