Sha256: a5e1c09eb565d3a3b31b803820408f3c21bd6a55c8ab3a871a60081a28427950

Contents?: true

Size: 1010 Bytes

Versions: 5

Compression:

Stored size: 1010 Bytes

Contents

# encoding: utf-8
require "logstash/filters/base"

# This  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 .
class LogStash::Filters::Joao < LogStash::Filters::Base

  # Setting the config_name here is required. This is how you
  # configure this filter from your Logstash config.
  #
  # filter {
  #    {
  #     message => "My message..."
  #   }
  # }
  #
  config_name "joao"

  # Replace the message with this value.
  config :message, :validate => :string, :default => "Hello World!"


  public
  def register
    # Add instance variables
  end # def register

  public
  def filter(event)

    if @message
      # Replace the event message with our message as configured in the
      # config file.
      event.set("message", @message)
    end

    # filter_matched should go in the last line of our successful code
    filter_matched(event)
  end # def filter
end # class LogStash::Filters::Joao

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
logstash-filter-joao-0.0.5 lib/logstash/filters/joao.rb
logstash-filter-joao-0.0.4 lib/logstash/filters/joao.rb
logstash-filter-joao-0.0.3 lib/logstash/filters/joao.rb
logstash-filter-joao-0.0.2 lib/logstash/filters/joao.rb
logstash-filter-joao-0.0.1 lib/logstash/filters/joao.rb