Recover
Synopsis
Recovers from errors that occurred in previous processors, allowing the pipeline to continue execution. Acts like a try-catch mechanism in programming languages.
Schema
- recover:
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 |
if | N | - | Condition to run |
ignore_failure | N | false | Continue processing if operation fails |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
tag | N | - | Identifier |
Details
The recover processor clears error states from previous processors, allowing the pipeline to continue execution as if no error occurred. It functions similarly to exception handling in programming languages, where errors are caught and handled gracefully.
Error Recovery Mechanism:
- Clears any error state from processors in the current
on_failurechain - Allows the pipeline to continue with subsequent processors
- Does not modify event data—purely handles error state
- Can be conditional using the
iffield
Common Use Cases:
- Parsing Failures: Recover when optional parsing fails (e.g., grok patterns, date formats)
- Enrichment Failures: Continue when external enrichment services are unavailable
- Validation Failures: Proceed with default values when validation fails
- Optional Processing: Make certain processing steps non-critical
The recover processor doesn't modify any data or fields. It serves purely as an error recovery mechanism to prevent pipeline termination due to previous failures.
This processor is most commonly used in error handling chains, at the end of optional processing sequences, or when you want to ensure that certain errors don't prevent the pipeline from completing.
Using recover will suppress all previous errors in the pipeline execution. Make sure this is the intended behavior before using this processor, as it can mask legitimate issues that should be addressed.
Examples
Basic Error Recovery
Recovering from pipeline errors... | |
prevents pipeline failure: | |
Conditional Recovery
Recovering only under specific conditions... | |
recovers based on condition: | |
Optional Processing Chain
Making an entire processing chain optional... | |
continues regardless of experimental processor outcome: | |
Multiple Error Handlers
Using recover after multiple fallback attempts... | |
recovers after all parsing attempts fail: | |
External Service Fallback
Recovering from external service failures... | |
continues when external API is unavailable: | |