Class: LogStash::Filters::HTMLEntities

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

Instance Method Summary collapse

Instance Method Details

#filter(event) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/logstash/filters/htmlentities.rb', line 24

def filter(event)

  if @source
    # Replace the event message with our message as configured in the
    # config file.
    event.set(@target, @coder.decode(event.get(@source)))
    # correct debugging log statement for reference
    # using the event.get API
    @logger.debug? && @logger.debug("#{@target} is now: #{event.get(@target)}")
  end

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

#registerObject



19
20
21
# File 'lib/logstash/filters/htmlentities.rb', line 19

def register
  @coder = HTMLEntities.new
end