diff --git a/docs/user_guide/event_processors/event_combine.md b/docs/user_guide/event_processors/event_combine.md index a42a6bf3..2d8e5914 100644 --- a/docs/user_guide/event_processors/event_combine.md +++ b/docs/user_guide/event_processors/event_combine.md @@ -20,6 +20,30 @@ processors: debug: false ``` +### Conditional Execution of Subprocessors + +The workflow for processing event messages can include multiple subprocessors, each potentially governed by its own condition. These conditions are defined using the jq query language, enabling dynamic and precise control over when each subprocessor should be executed. + +### Defining Conditions for Subprocessors + +When configuring your subprocessors, you have the option to attach a jq-based condition to each one. The specified condition acts as a gatekeeper, determining whether the corresponding subprocessor should be activated for a particular event message. + +### Condition Evaluation Process + +For a subprocessor to run, the following criteria must be met: + +Condition Presence: If a condition is specified for the subprocessor, it must be evaluated. + +Condition Outcome: The result of the jq condition evaluation must be true. + +Combined Conditions: In scenarios where both the main processor and the subprocessor have associated conditions, both conditions must independently evaluate to true for the subprocessor to be triggered. + +Only when all relevant conditions are met will the subprocessor execute its designated operations on the event message. + +It is important to note that the absence of a condition is equivalent to a condition that always evaluates to true. Thus, if no condition is provided for a subprocessor, it will execute as long as the main processor's condition (if any) is met. + +By using conditional execution, you can build sophisticated and efficient event message processing workflows that react dynamically to the content of the messages. + ### Examples In the below example, we define 3 regular processors and 2 `event-combine` processors. @@ -68,7 +92,7 @@ processors: pipeline2: event-combine: processors: - - condition: '.tags[\"subscription-name\"] == \"sub2\"' + - condition: '.tags["subscription-name"] == "sub2"' name: proc2 - name: proc3 ```