Class: LogStash::Filters::RFC2047

Inherits:
Base
  • Object
show all
Defined in:
lib/logstash/filters/rfc2047.rb

Instance Method Summary collapse

Instance Method Details

#filter(event) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/logstash/filters/rfc2047.rb', line 18

def filter(event)

  @field.each do |f| 
    msg = event[f]
    if ((msg =~ /=\?((?:ISO|UTF)-[0-9]{1,4}(?:-[0-9])?)\?/i) && (msg.encoding.to_s=="UTF-8"))
       event[f] = Rfc2047.decode(msg.encode("utf-8"), $1)
       # correct debugging log statement for reference
       # using the event.get API
       @logger.debug? && @logger.debug("Message is now: #{event["message"]})")
    end
  end

  # filter_matched should go in the last line of our successful code
  filter_matched(event)
end

#registerObject



13
14
15
# File 'lib/logstash/filters/rfc2047.rb', line 13

def register
  # Add instance variables
end