Class: LogStash::Filters::Oui

Inherits:
Base
  • Object
show all
Defined in:
lib/logstash/filters/oui.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



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/logstash/filters/oui.rb', line 36

def filter(event)

  oui = OUI.find event[@source]
  if ! oui.nil?
    event[@target] = Hash.new
    oui.each do |key, value|
      event[@target][key.to_s] = value
    end

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

#registerObject



30
31
32
33
# File 'lib/logstash/filters/oui.rb', line 30

def register
  # Add instance variables 
  require 'oui'
end