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 | - | Maximum number of values to expand |
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 |
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. Use max_values
to prevent excessive memory usage or processing time. The processor checks this limit during expansion and fails safely if exceeded.
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, while a /16 network generates 65,536 IPs. Always set appropriate max_values
limits for network expansions.
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: |
|