Class: LogStash::Filters::Hola

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

Overview

This is our “Hello, World!” filter plugin. It adds a simple greeting field to every event.

Instance Method Summary collapse

Instance Method Details

#filter(event) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/logstash/filters/hola.rb', line 20

def filter(event)
  # This method is called for every event that passes through the filter.
  event.set("greeting", "Hello, world! from the hola plugin.")

  # This is important! It signals that the event was successfully filtered
  # and should be passed to the next stage in the pipeline.
  filter_matched(event)
end

#registerObject



14
15
16
17
# File 'lib/logstash/filters/hola.rb', line 14

def register
  # This method is called once when the plugin is initialized.
  # No setup needed for this simple plugin.
end