Introduction¶
Filters provide a powerful mechanism to apply constraints on the events in order to determine a validity.
If filters determine an event is valid, this will trigger the action defined by the Sensor.
If filters determine an event is not valid, this won't trigger any action.
Types¶
Argo Events offers 5 types of filters:
⚠️
PLEASE NOTEthis is the order in which Sensor evaluates filter types: expr, data, context, time.
Logical operator¶
Filter types can be evaluated together in 2 ways:
and, meaning that all filters returningtrueare required for an event to be validor, meaning that only one filter returningtrueis enough for an event to be valid
Any kind of filter error is considered as false (e.g. path not existing in event body).
Such behaviour can be configured with filtersLogicalOperator field in a Sensor dependency, e.g.
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: multiple-filters-example
spec:
dependencies:
- name: sample-dependency
eventSourceName: webhook
eventName: sample-event
filtersLogicalOperator: "or"
filters:
# ...
Available values:
""(empty), defaulting toandand, default behaviouror
⚠️
PLEASE NOTELogical operator values must belower case.
Examples¶
You can find some examples here.