Final
Synopsis
Completes all pipeline processing for the current event, indicating that the data is finalized and no further processing is needed.
Schema
- final:
description: <text>
if: <script>
ignore_failure: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>
Configuration
The following fields are used to define the processor:
| Field | Required | Default | Description |
|---|---|---|---|
description | N | - | Explanatory note for documentation |
if | N | - | Condition determining when to finalize processing |
ignore_failure | N | false | If true, condition evaluation errors are ignored |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
tag | N | - | Identifier for the finalization point |
Details
The final processor marks the event as complete and stops all further pipeline processing. It signals that the data has reached its final state and requires no additional transformation or enrichment.
Key Characteristics:
- Stops all subsequent processors in the current pipeline
- Prevents execution of any additional pipelines configured for the event
- The event continues to its configured destinations with its current state
- Useful for creating explicit completion points in complex pipeline flows
The processor executes any on_success handlers before finalizing, allowing for cleanup operations, logging, or final metadata updates.
Typical uses:
-
Early Exit on Success
- append:
field: tags
value: processed
- final:
if: "ctx.tags.contains('processed')" -
Prevent Duplicate Processing
- set:
field: processed_by
value: pipeline_a
- final:
description: "Prevent other pipelines from processing" -
Conditional Pipeline Branch
- final:
if: "ctx.environment == 'production'"
description: "Skip test processors in production"
- set:
field: test_field
value: test_value
It is good practice to use detailed description to document the finalization points. Also, consider adding cleanup tasks using on_success, test conditional finalization thoroughly, and use tags for tracking finalization points in logs.
Once final is used, no further processors in any pipeline will execute. The event will be sent to its configured destinations with its current state. Use with caution in multi-pipeline setups, and consider using if to prevent unintended early termination.
Examples
Basic
Stopping processing after the field update... | |
prevents further processing: | |
Conditionals
Finalizing based on packet count... | |
stops the process when the condition is met: | |
Success
Executing cleanup on finalization... | |
terminates the pipeline gracefully: | |