Drops events and emits a warning if the invariant is violated.
assert invariant:bool
Description
Section titled “Description”The assert
operator asserts that invariant
is true
for events. In case an
event does not satisfy the invariant, it is dropped and a warning is emitted.
Examples
Section titled “Examples”Make sure that x != 2
Section titled “Make sure that x != 2”from {x: 1}, {x: 2}, {x: 3}assert x != 2
{x: 1}// warning: assertion failure{x: 3}
Check that a topic only contains certain events
Section titled “Check that a topic only contains certain events”subscribe "network"assert @name == "ocsf.network_activity"// continue processing