lib/sensu/server/filter.rb
def native_filter(filter_name, event)
        filter = @settings[:filters][filter_name]
        if in_filter_time_windows?(filter)
          matched = attributes_match?(event, filter[:attributes])
          yield(filter[:negate] ? matched : !matched, filter_name)
        else
          yield(false, filter_name)
        end
      end
# Determine if an event is filtered by a native filter.
#
# @param filter_name [String]
# @param event [Hash]
# @yield [filtered] callback/block called with a single
#   parameter to indicate if the event was filtered.
# @yieldparam filtered [TrueClass,FalseClass] indicating if the
#   event was filtered.
# @yieldparam filter_name [String] name of the filter being evaluated
Determine if an event is filtered by a native filter.
Determine if an event is filtered by a native filter .
def native_filter(filter_name, event)
        filter = @settings[:filters][filter_name]
        if in_filter_time_windows?(filter)
          matched = attributes_match?(event, filter[:attributes])
          yield(filter[:negate] ? matched : !matched, filter_name)
        else
          yield(false, filter_name)
        end
      end
def native_filter ( filter_name , event ) filter = @settings [ :filters ] [ filter_name ] if in_filter_time_windows? ( filter ) matched = attributes_match? ( event , filter [ :attributes ] ) yield ( filter [ :negate ] ? matched : ! matched , filter_name ) else yield ( false , filter_name ) end end
Determine if an event is filtered by a native filter.
Determine if an event is filtered by a native filter .
filter_name
name of the filter being evaluated
name of the filter being evaluated
event
None
]
callback/block called with a single parameter to indicate if the event was filtered.
callback / block called with a single parameter to indicate if the event was filtered .
filtered
indicating if the event was filtered.
indicating if the event was filtered .