Filter Processor

Description

The Filter by Field processor allows events to pass based on the presence of a specific key-value pair. Events that return true for the comparison operands are forwarded.

Use

You can use this processor to drop events that may not be meaningful, or to reduce the total amount of data forwarded to a subsequent processor or destination. This can be useful, for example, for dropping events that may be DEBUG level and not needed for long term storage, or metrics that are zero and should not need to be recorded.

Configuration

The Filter processor uses conditional statements to set the filter criteria. The format of this conditional statement is: Field (comparison operator) Value. You can add conditions including AND and OR, as well as nested expressions. A Filter Processor can contain multiple conditional statements.

OptionDescriptionExample
FieldThe field you want to apply the filter to..foo
OperatorThe type of operator to use for the filter.greater
ValueThe value for the operator to use.10

The filter terms you enter for Value are treated as case-insensitive by default. Click the button next to the Value field to activate case-sensitivity.

Operators

Contents Operators

OperatorDescriptionExample
Not ContainsAccepts string values. Will drop the record if it does not contain the value in the string.
ContainsAccepts string values. Will drop the record if it contains the value in the string.bar
ExistsDrops the record if the field exists
Not ExistsDrops the record if the field does not exist

String Operators

OperatorDescriptionExample
Ends WithThe contents of a given field ends with.bar
Starts WithThe contents of a given field starts with.foo

Comparison Operators

OperatorDescriptionExample
GreaterAccepts only numeric values.10
Greater or EqualAccepts only numeric values.10
LessAccepts only numeric values.10
Less or EqualAccepts only numeric values.10
EqualAccepts both numeric and string values. Does a string comparison on non string fields.bar
Not EqualAccepts both numeric and string values. Does a string comparison on non string fields.bar

Type Operators

OperatorDescriptionExample
Is ArrayDrops the record if the field is not an array.[ "foo", "bar" ]
Is BooleanDrops the record if the field is not a boolean.true
Is EmptyDrops the record if the field does not contain an empty string, array or object.""
Is NullDrops the record if the field is not null.null
Is NumberDrops the record if the field is not a numeric.123.45
Is ObjectDrops the record if the field is not an object.{ "foo": "bar" }
Is StringDrops the record if the field is not a string."This is foo bar"

Examples

Filter Greater

Before

JSON
Copy

Filter Options

OptionValue
Field.foo
Operatorgreater
Value10

After

JSON
Copy

Filter Equals

Before

JSON
Copy

Filter Options

OptionValue
Field.foo
Operatorequal
Value10

After

JSON
Copy

Filter Contains

Before

JSON
Copy

Filter Options

OptionValue
Field.foo
Operatorcontains
Value10
Case SensitiveOn

After

JSON
Copy

Filter is Empty

Before

JSON
Copy

Filter Options

OptionValue
Field.foo
Operatoris_empty

After

JSON
Copy

Filter Debug Data

In some cases, log data streams include extraneous data such as Debug level information. These would normally not be needed in the production monitoring stream and can be discarded.

This example uses the log level field as a filtering operator to drop anything with a DEBUG value.

Before

JSON
Copy

Filter Options

OptionValue
Field.level
Operatornot_equal
Valuedebug

After

JSON
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated