Discard
Synopsis
Removes staged routes from the pipeline processing flow, either targeting a specific destination or discarding all staged routes at once.
Schema
- discard:
destination: <string>
target: <string>
Configuration
| Field | Required | Default | Description |
|---|---|---|---|
destination | N | Destination route to remove from staged routes. Supports templating. If empty, discards all staged routes. | |
target | N | Alias for destination field. |
Details
The discard processor removes routes from the StagedRoutes map before they are committed to actual routing. This enables conditional route discarding based on data content or processing logic.
When destination is specified, the processor removes only that destination from staged routes. If the destination does not exist in staged routes, the processor returns an error unless ignore_failure is set to true.
When destination is not specified, the processor clears all staged routes from the map, preventing any staged routes from being committed.
The destination field supports template syntax, allowing dynamic destination selection based on log entry field values.
The processor fails silently when no staged routes exist, returning no error regardless of the destination value.
Examples
Discard Specific Destination
Staging multiple routes to different destinations... | |
Discarding only the sentinel route while preserving azdx... | |
Discard All Staged Routes
Staging routes for sentinel, azdx, and lake destinations... | |
Clearing all staged routes at once... | |
Conditional Discard
Log entry with discard decision field... | |
Route discarded when condition evaluates to true... | |
Templated Destination
Using log field value to determine which route to discard... | |
Template resolves to sentinel and removes that staged route... | |
Ignore Missing Destination
Attempting to discard non-existent destination with failure ignored... | |
Processor continues despite error, preserving original staged route... | |
Multiple Discard Operations
Complex staging scenario with selective discard and commit... | |
Final state shows only azdx committed, all others discarded... | |