class LogStash::Filters::Punct

Strip everything but punctuation from a field and store the remainder in the a separate field. This is often used for fingerprinting log events.

Public Instance Methods

filter(event) click to toggle source
# File lib/logstash/filters/punct.rb, line 23
def filter(event)
  return unless filter?(event)

  original_value = event[@source]

  # If for some reason the field is an array of values, take the first only.
  original_value = original_value.first if original_value.is_a?(Array)
  event[@target] = original_value.tr('A-Za-z0-9 \t','')
end
register() click to toggle source
# File lib/logstash/filters/punct.rb, line 18
def register
  # Nothing to do
end