Sha256: d509b01f7dfb9b6d295b721a9db41c1a45c2e0db7e7454176a67c6dd84c276dd

Contents?: true

Size: 580 Bytes

Versions: 9

Compression:

Stored size: 580 Bytes

Contents

require "logstash/filters/base"
require "logstash/namespace"
require "ostruct"

class LogStash::Filters::Field < LogStash::Filters::Base
  class EvalSpace < OpenStruct
    def get_binding
      return binding
    end
  end

  public
  def register
    # nothing to do
  end # def register

  public
  def filter(event)
    data = EvalSpace.new(event.to_hash)

    @config.each do |condition|
      if data.instance_eval(condition)
        return # This event is OK, matches the condition.
      end
    end
    event.cancel
  end # def filter
end # class LogStash::Filters::Field

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
logstash-lite-0.2.20110505142231 lib/logstash/filters/field.rb
logstash-lite-0.2.20110422152244 lib/logstash/filters/field.rb
logstash-lite-0.2.20110405105201 lib/logstash/filters/field.rb
logstash-lite-0.2.20110331121236 lib/logstash/filters/field.rb
logstash-lite-0.2.20110329105411 lib/logstash/filters/field.rb
logstash-lite-0.2.20110206003603 lib/logstash/filters/field.rb
logstash-lite-0.2.20110203130400 lib/logstash/filters/field.rb
logstash-lite-0.2.20110122143801 lib/logstash/filters/field.rb
logstash-lite-0.2.20110112115019 lib/logstash/filters/field.rb