class LogStash::Filters::FetchStrategy::Memory::RegexUnion

Public Class Methods

new(dictionary) click to toggle source
# File lib/logstash/filters/fetch_strategy/memory.rb, line 36
def initialize(dictionary)
  @dictionary = dictionary
  @union_regex_keys = Regexp.union(@dictionary.keys)
end

Public Instance Methods

fetch(source, results) click to toggle source
# File lib/logstash/filters/fetch_strategy/memory.rb, line 41
def fetch(source, results)
  value = source.gsub(@union_regex_keys, @dictionary)
  if source == value
    results[0] = false
  else
    results[1] = LogStash::Util.deep_clone(value)
  end
end