Permalink
Browse files

add warning if use missing placeholder

  • Loading branch information...
y-ken committed Dec 17, 2013
1 parent 502f80f commit 5685a35caaf9ce90681fd9c002ce67c27b2c2a4f
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/fluent/plugin/out_rewrite_tag_filter.rb
@@ -66,7 +66,10 @@ def rewrite_tag(tag, record)
backreference_table = get_backreference_table($~.captures)
rewritetag = rewritetag.gsub(/\$\d+/, backreference_table)
end
rewritetag = rewritetag.gsub(/(\${[a-z_]+(\[[0-9]+\])?}|__[A-Z_]+__)/, placeholder)
rewritetag = rewritetag.gsub(/(\${[a-z_]+(\[[0-9]+\])?}|__[A-Z_]+__)/) do
$log.warn "rewrite_tag_filter: unknown placeholder found. :placeholder=>#{$1} :tag=>#{tag} :rewritetag=>#{rewritetag}" unless placeholder.include?($1)
placeholder[$1]
end
return rewritetag
end
return nil

0 comments on commit 5685a35

Please sign in to comment.