Skip to content

block - Remove documents matching the predicate

The block keyword filters out all events where the given predicate is true. This is the functional inverse of filter, which will only allow events where the predicate is true.

Syntax

block <boolean expression>

Example - Blocking all healthy status codes

In this example, we have a document with a field status_code which represents a HTTP status response code. We're interested only in those values outside of the happy path, including redirects. This means removing any status code beginning with 2. We can do this using the startsWith string function and the block keyword.

block $d.status_code.startsWith('2')