1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00
Files
openshift-docs/modules/kn-trigger-filtering.adoc
2020-11-10 21:02:28 +00:00

24 lines
890 B
Plaintext

// Module included in the following assemblies:
//
// * /serverless/event_workflows/serverless-using-brokers.adoc
[id="kn-trigger-filtering_{context}"]
= Filtering events using triggers
In the following trigger example, only events with the attribute `type: dev.knative.samples.helloworld` will reach the event sink.
[source,terminal]
----
$ kn trigger create <trigger_name> --broker <broker_name> --filter type=dev.knative.samples.helloworld --sink ksvc:<service_name>
----
You can also filter events using multiple attributes. The following example shows how to filter events using the type, source, and extension attributes.
[source,terminal]
----
$ kn trigger create <trigger_name> --broker <broker_name> --sink ksvc:<service_name> \
--filter type=dev.knative.samples.helloworld \
--filter source=dev.knative.samples/helloworldsource \
--filter myextension=my-extension-value
----