A component to filter the incoming data based on an arbitrary JSONata expression.
Filter will pass through the incoming data if it matches the JSONata condition specified in the configuration. The expression can be any valid JSONata expression, so you can be creative. Here are some examples that are possible:
true
false
$not(false)
$not(true)
20 > 5
body.foo
- will be true ifbody.foo
is defined and notfalse
By default no environment variable is necessary to operate the component.
This component has no trigger functions, so it is not selectable as a trigger (first step in an integration flow).
This action has two parameters and a checkbox:
Parameters:
Filter condition
- A JSONata expression passed in through the cfg. The expression will be evaluated to a value oftrue
orfalse
. If it is evaluated tofalse
, a message will be logged to the console and the msg will not be sent forward to the next component. If evaluatedtrue
, a message will be passed forward along with all data that passed the condition.
Checkbox:
-
If checked, the checkbox adds
Assertion
functionality. Instead of doing nothing, the component will throw an error when the condition is not met. -
Metadata To Response
Adding passthrough from a previous step to message body aselasticioMeta
variable, if enabled.
- The JSONata Filter expression can be a valid expression however it can cause an error to be thrown if it is invalid based on the context. For example,
$number(hello) > 5
wherehello: "world"
. This JSONata expression is valid but an error will be thrown ashello
is NaN.
Apache-2.0 © elastic.io GmbH