Drop
Synopsis
Conditionally stops processing of a document by dropping it from the pipeline.
Schema
- drop:
if: <script>
filter: <script>
description: <text>
tag: <string>
Configuration
The following fields are used to define the processor:
| Field | Required | Default | Description |
|---|---|---|---|
if | N | - | Condition that determines whether to drop the document |
filter | N | - | Cribl-style JavaScript truthiness expression evaluated after if. A falsy result silently skips the processor, leaving the document in the pipeline. Distinct from if, which uses the native expression language |
description | N | - | Explanatory note |
tag | N | - | Identifier |
disabled | N | false | When true, the processor is skipped and the event continues to the next one. Lets you take a processor out of the path without removing its configuration |
This processor does not accept on_success, on_failure or ignore_failure. Its whole job is to signal a control-flow decision to the pipeline runner, and it returns that signal directly — there is no success or failure outcome for a handler to run against. if, tag and disabled work normally.
Details
This processor is particularly useful for filtering out unwanted documents based on their content or metadata without raising exceptions.
Common uses are filtering debug logs, excluding health checks, and dropping internal traffic.
Once dropped, a document cannot be recovered by the subsequent processors. Use caution with complex conditions to avoid accidentally dropping important documents.
Examples
Basic
Dropping documents with a specific packet count... | |
removes them from the pipeline: | |
Multiple Conditions
Specifying multiple criteria... | |
filters out documents that meet the combined conditions: | |
Complex Filtering
Using complex conditions... | |
filters out those traffic patterns: | |
Error Handling
A condition that does not match leaves the document in the pipeline: evaluateCondition returns the skip sentinel and drop never reaches its drop signal. If the condition cannot be evaluated at all, the evaluation error is returned to the pipeline runner instead, and the document is again not dropped.
drop accepts no ignore_failure, so neither outcome can be suppressed from the processor itself. Guard the condition instead — check that the field exists before testing its value.