Fluentd Conditional Matches Based on Environment Variables

You can enable/disable FluentD Matches with environment variables in following way. Below is fluent.conf. <source> @type dummy dummy {"hello":"world"} @label @DUMMY tag dummy </source> <label @DUMMY> <match dummy> @type copy copy_mode deep <store> @type relabel @label @OPENSEARCH </store> <store> @type relabel @label @ELASTICSEARCH </store> </match> </label> <label @OPENSEARCH> @include "#{ENV['FLUENTD_OPENSEARCH']}" </label> <label @ELASTICSEARCH> @include "#{ENV['FLUENTD_ELASTICSEARCH']}" </label> Following is the content for fluent-elasticsearch.conf. For testing purpose, we will send events to stdout....

November 18, 2024 · 1 min · Imran

Fluentd Multiple Filters Matches for Same Source

You can try using plugins copy and relabel to achieve this. Example configuration looks like this. //One Source <source> @type tail tag service path /tmp/l.log format json read_from_head true </source> //Now Copy Source Events to 2 Labels <match service> @type copy <store> @type relabel @label @data </store> <store> @type relabel @label @pi2 </store> </match> //@data Label, you can perform desired filter and output file <label @data> <filter service> ... </filter> <match service> @type file path /tmp/out/data </match> </label> //@pi2 Label, you can perform desired filter and output file <label @pi2> <filter service> ....

August 3, 2024 · 1 min · Imran