From 76c60c24e162d7dfb7c5b90f72b2c7a6e1208240 Mon Sep 17 00:00:00 2001 From: harshit-splunk <89519921+harshit-splunk@users.noreply.github.com> Date: Wed, 15 Dec 2021 00:45:44 +0530 Subject: [PATCH] enabled tag interpolation for source value (#203) --- lib/fluent/plugin/out_splunk.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fluent/plugin/out_splunk.rb b/lib/fluent/plugin/out_splunk.rb index c2bd758..ee3e069 100644 --- a/lib/fluent/plugin/out_splunk.rb +++ b/lib/fluent/plugin/out_splunk.rb @@ -193,8 +193,8 @@ def prepare_key_fields v = instance_variable_get "@#{f}" next unless v - if v == TAG_PLACEHOLDER - instance_variable_set "@#{f}", ->(tag, _) { tag } + if v.include? TAG_PLACEHOLDER + instance_variable_set "@#{f}", ->(tag, _) { v.gsub(TAG_PLACEHOLDER, tag) } else instance_variable_set "@#{f}", ->(_, _) { v } end