Method: Fluent::Plugin::Output#get_placeholders_tag

Defined in:
lib/fluent/plugin/output.rb

#get_placeholders_tag(str) ⇒ Object

-1 means whole tag



780
781
782
783
784
785
786
787
788
789
790
791
# File 'lib/fluent/plugin/output.rb', line 780

def get_placeholders_tag(str)
  # [["tag"],["tag[0]"]]
  parts = []
  str.scan(CHUNK_TAG_PLACEHOLDER_PATTERN).map(&:first).each do |ph|
    if ph == "tag"
      parts << -1
    elsif ph =~ /^tag\[(-?\d+)\]$/
      parts << $1.to_i
    end
  end
  parts.sort
end