Filter
The Filter operator filters events in user space. Since the filtering in user space is slower, it's preferred to use in-ebpf filtering options when possible, as provided by other operators like LocalManager and KubeManager or specific parameters provided by each gadget.
Priority
9000
Instance Parameters
filter
This parameter allows you to filter events based on specific field values provided by the gadget. This is particularly useful for narrowing down the output to entries that meet certain criteria.
The filter syntax supports the following operations:
field==value
: Matches if the content offield
equals exactlyvalue
.field!=value
: Matches if the content offield
does not equal exactlyvalue
.field>=value
: Matches if the content offield
is greater than or equal tovalue
.field>value
: Matches if the content offield
is greater thanvalue
.field<=value
: Matches if the content offield
is less than or equal tovalue
.field<value
: Matches if the content offield
is less thanvalue
.field~value
: Matches if the content offield
matches the regular expressionvalue
. See RE2 Syntax for more details.
Fully qualified name: operator.filter.filter
multiple filters
You can specify multiple filters by separating them with a comma. The filter field1==value1,field2==value2
will match only events where field1
equals value1
and field2
equals value2
.
Also, you can use backslash (\
) to escape comma in the value.