On the fly Changes in Logstash config file

Hello All,

I am aware of that logstash 2.2 introduces new pipeline architecture and auto reload option.

I have following question :
Static modification in Logstash conf file :

I am using environment filter to add some fields in my logstash config file. Its working perfect. I want to have only one logstash config for my production environment. I dont want devops or dev person to be told to start this logstash instance with this config file. There has to be ONLY one config file.
Now let us say I have 3 ES clusters
1: amer.region.company.com
2: europe.region.company.com
3: asia.region.company.com

How can I change logstash config file before starting logstash so that I can have one of three ES cluster name / IP address inside ES output plugin for logstash.

I have something like this :
elasticsearch {
hosts => ["amer.region.company.com:9200"]
}

Thanks,
Gaurav

Wouldn't this be a good job for the configuration management system you're using?

Since Logstash nowadays supports environment variable references in strings (not just via the environment filter), perhaps you could use that to pick up a cluster hostname.

1 Like

BTW, the feature Magnus is referring to was implemented here: https://github.com/elastic/logstash/pull/4710. It will be available in the next Logstash release, 2.3.0.

1 Like