Sha256: 5215aa0827a1293a5f152ab2b1f617d2ebfe4225a462779063c8861669c91128

Contents?: true

Size: 689 Bytes

Versions: 2

Compression:

Stored size: 689 Bytes

Contents

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

# Drop filter.
#
# Drops everything that gets to this filter.
#
# This is best used in combination with conditionals, for example:
#
#     filter {
#       if [loglevel] == "debug" { 
#         drop { } 
#       }
#     }
#
# The above will only pass events to the drop filter if the loglevel field is
# "debug". This will cause all events matching to be dropped.
class LogStash::Filters::Drop < LogStash::Filters::Base
  config_name "drop"
  milestone 3

  public
  def register
    # nothing to do.
  end

  public
  def filter(event)
    event.cancel
  end # def filter
end # class LogStash::Filters::Drop

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
logstash-filter-drop-0.1.0 lib/logstash/filters/drop.rb
logstash-lib-1.3.2 lib/logstash/filters/drop.rb