Expand Range
Synopsis
Expands range expressions into arrays of individual values.
Schema
- expand_range:
field: <ident>
target_field: <string>
range_type: <string>
separator: <string>
range_separator: <string>
step_separator: <string>
output_format: <string>
output_separator: <string>
sort: <boolean>
unique: <boolean>
reverse: <boolean>
max_values: <integer>
pad_zeros: <integer>
prefix: <string>
suffix: <string>
validate_range: <boolean>
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 | - | Source field containing range expression to expand |
target_field | N | Same as field | Target field to store expanded values |
range_type | N | numeric | Range type (numeric, port, ip, ipv6, cidr, letter, alphanumeric, custom) |
separator | N | , | Separator for multiple ranges |
range_separator | N | - | Separator for range bounds (start-end) |
step_separator | N | : | Separator for step values (1-10:2) |
output_format | N | array | Output format (array, string, count, min_max, json) |
output_separator | N | , | Separator for string output format |
sort | N | false | Sort the expanded values |
unique | N | false | Remove duplicate values |
reverse | N | false | Reverse the order of values |
max_values | N | 1048576 | Maximum number of values to expand. A hard ceiling of 1,048,576 applies regardless: leaving this unset, or setting it higher, still stops at that number. A range that would exceed the effective limit fails the processor rather than truncating |
pad_zeros | N | - | Pad numbers with leading zeros |
prefix | N | - | Add prefix to each expanded value |
suffix | N | - | Add suffix to each expanded value |
validate_range | N | false | Validate range bounds (e.g., ports 1-65535) |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | Continue processing if expansion fails |
ignore_missing | N | false | Skip processing if referenced field doesn't exist |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
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 |
Details
Expands range expressions into individual values supporting various data types including numbers, IP addresses, ports, letters, and custom patterns. The processor handles multiple range formats with step values and extensive output customization.
The processor supports different range types with intelligent expansion logic. Numeric ranges support step values (1-10:2 = 1,3,5,7,9), IP ranges handle both full addresses and subnet expansions, and alphanumeric ranges can expand patterns like "host001-host010".
Range expansion can generate large numbers of values. The processor stops with an error the moment the limit is reached — it does not return a truncated list, so a partial expansion can never be mistaken for a complete one.
There is no unlimited setting. max_values lowers the ceiling; it cannot raise it past 1,048,576. That bound exists so a range such as 0.0.0.0/0 fails cleanly instead of exhausting memory.
The processor offers multiple output formats including arrays, formatted strings, counts, and JSON objects with metadata. Post-processing options include sorting, deduplication, and value transformation with prefixes/suffixes.
CIDR expansion can generate thousands of IP addresses. A /24 network produces 256 IPs and a /16 network 65,536 — both well inside the ceiling. A /12 produces 1,048,576 and a /11 exceeds it and fails.
Examples
Basic Numeric Range
Expanding simple numeric range... | |
creates array of values: | |
Port Range with Validation
Expanding port ranges with validation... | |
expands and validates port numbers: | |
IP Address Range
Expanding IP address ranges... | |
generates IP addresses with metadata: | |
Step-based Numeric Range
Using step values for numeric expansion... | |
creates stepped sequence: | |
Alphanumeric Pattern Expansion
Expanding alphanumeric host patterns... | |
generates formatted hostnames: | |
CIDR Network Expansion
Expanding CIDR network notation... | |
returns network size information: | |
Letter Range with Formatting
Expanding letter ranges with case formatting... | |
creates formatted column names: | |