Min
Synopsis
Calculates the minimum value between two numeric operands.
Schema
- min:
field: <ident>
left_operand: <string>
right_operand: <string>
description: <text>
if: <script>
ignore_failure: <boolean>
ignore_missing: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>
Configuration
The following fields are used to define the processor:
Field | Required | Default | Description |
---|---|---|---|
field | Y | - | Target field to store the minimum value |
left_operand | Y | - | First value to compare - can be a literal value or field reference |
right_operand | Y | - | Second value to compare - can be a literal value or field reference |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | Continue processing if comparison fails |
ignore_missing | N | false | Skip if referenced fields don't exist |
on_failure | N | - | Error handling processors |
on_success | N | - | Success handling processors |
tag | N | - | Identifier |
Details
Compares two numeric values and stores the smaller value in the target field. The processor can use literal values or extract values from existing fields in the log entry.
Numeric values are automatically converted to appropriate types for comparison. The processor accepts both literal values and field references for operands.
The processor is useful for finding minimum values, implementing floor functions, and ensuring values don't exceed maximum thresholds.
If either operand cannot be converted to a number, the processor will fail unless ignore_failure
is set to true
. Always ensure inputs are valid numbers or provide proper error handling.
Examples
Basic
Comparing two literal values... |
|
stores the smaller value: |
|
Field-Based
Finding minimum between field values... |
|
finds lowest temperature of the day: |
|
Thresholds
Ensuring value doesn't exceed threshold... |
|
enforces maximum limit: |
|
Resource Allocation
Allocating resources based on availability... |
|
uses minimum of requested vs. available: |
|