Multiple logstash output configurations

I've been trying to find information on this and started to wonder if it's even possible.
Situation is as follows.
We have several logstash pipeline configuration files. All of them have their output largely the same, just some smaller differences.

Is there a way where we could use two configuration files for the same output to elasticsearch?
The shared part would contain the following:

   output {
      elasticsearch {
   		hosts => ["localhost:9200"]
   		user => "logstash_writer"
   		password => ...
   		ssl => true
   		cacert => "/path/elasticsearch-ca.pem"
      }
   }

but then we have fields that differ from pipeline to pipeline such as index, document_id, ilm_pattern, etc

Is there a way to load in a separate file for just those extra lines inside the output/elasticsearch section? Or load in this file in those configuration files?

You could try doing this using sprintf references to metadata fields set earlier in the pipeline.

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