Class: LogStash::Filters::Example

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

Overview

This example filter will replace the contents of the default message field with whatever you specify in the configuration.

It is only intended to be used as an example.

Instance Method Summary collapse

Instance Method Details

#filter(event) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/logstash/filters/example.rb', line 32

def filter(event)

  if @message
    # Replace the event message with our message as configured in the
    # config file.
    event["message"] = @message
  end

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

#registerObject



27
28
29
# File 'lib/logstash/filters/example.rb', line 27

def register
  # Add instance variables 
end