-
Notifications
You must be signed in to change notification settings - Fork 181
Description
Proposal — Command syntax, options, and precise semantics
Command
mvcombine <field> [delim="<string>"]
Arguments
field (required)
The name of the field whose values will be combined.
- Must be a direct field reference.
- Must be a single-valued (scalar) field.
- If the field does not exist in the current schema, the command fails.
delim (optional)
Defines the delimiter to be used when rendering a single-value representation of the combined field.
- Default: a single space (
" "), consistent with Splunk. - Ignored unless
nomvis implemented and used. - Present for syntax compatibility with Splunk and forward extensibility.
Precise semantics
mvcombine operates on the current result set produced by the pipeline.
Grouping rules
Rows are grouped where all fields except <field> have identical values.
- Grouping is not limited to adjacent rows.
- All rows in the current result set are considered.
For each group
- All non-target fields are preserved as group keys.
<field>becomes a multivalue field containing the combined values from the group.
Value inclusion
- Rows where the target field is missing or null do not contribute a value to the combined output.
- Rows that differ only by the target field are collapsed into a single output row.
Ordering
- Value order in the multivalue field follows the input stream order at the point where
mvcombineexecutes. - If deterministic ordering is required, users must apply
sortbeforemvcombine.
Error handling
The command fails with an error if:
- The target field does not exist in the current schema.
- The target is not a direct field reference.
- The target field is already a multivalue (array) type.
Examples
- Basic
Input:
| user | action | id |
| joe | login | 1 |
| joe | login | 2 |
| joe | logout | 3 |
Query:
... | mvcombine id
Output:
| user | action | id |
| joe | login | [1,2] |
| joe | logout | [3] |
- Non-consecutive
Input:
| user | action | id |
| joe | login | 1 |
| sam | login | 5 |
| joe | login | 2 |
Query:
... | mvcombine id
Output:
| user | action | id |
| joe | login | [1,2] |
| sam | login | [5] |
- Missing target field
Input:
| user | action | id |
| joe | login | 1 |
| joe | login | |
| joe | login | 2 |
Query:
... | mvcombine id
Output:
| user | action | id |
| joe | login | [1,2] |
Rows missing the target field do not contribute values.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status