Skip to content

Expand

Expand (expand)

expand data in various ways: events, XML, multiline events.

Transform json

Minimal example

actions:
- expand:
mode:
csv: {}
JSON
{
"actions": [
{
"expand": {
"mode": {
"csv": {}
}
}
}
]
}

Contents

Fields

FieldTypeRequiredDescription
mode ModeModeExpansion strategy to apply.
description Generalstringdescribe this step.
condition Generallua-expression (string)Only run this action if the specified condition is met.
Examples: 2 * count()
delim GeneralstringOptional delimiter used for multiline expansion helpers.
suppress-warnings Generalboolean (bool)Suppress warnings generated by this action.
input-field Inputfield (string)Select an input field to expand instead of using the full event.
Examples: data_field
document-mode Inputboolean (bool)Treat each document as a standalone expansion boundary.
remove Outputboolean (bool)Remove the source field once expansion is complete.

General

Show fields
FieldTypeRequiredDescription
descriptionstringdescribe this step.
conditionlua-expression (string)Only run this action if the specified condition is met.
Examples: 2 * count()
delimstringOptional delimiter used for multiline expansion helpers.
suppress-warningsboolean (bool)Suppress warnings generated by this action.

Input

Show fields
FieldTypeRequiredDescription
input-fieldfield (string)Select an input field to expand instead of using the full event.
Examples: data_field
document-modeboolean (bool)Treat each document as a standalone expansion boundary.

Output

Show fields
FieldTypeRequiredDescription
removeboolean (bool)Remove the source field once expansion is complete.

Mode

Show fields
FieldTypeRequiredDescription
modeModeExpansion strategy to apply.

Schema

Mode Options

OptionNameTypeDescription
csvCsvobjectParse delimited payloads into structured records.
key-valueKey ValueobjectParse key=value formatted payloads.
eventsEventsobjectSplit embedded arrays or records into multiple events.
xmlXmlobjectExpand XML arrays into individual events.
multilineMultilinemapSplit multi-line text payloads using the delimiter map.
jsonJsonboolTreat payload as JSON lines (true) or arrays (false).

Mode - Csv - Header Fields Fields

FieldTypeRequiredDescription
header-fieldfield (string)Field containing header (CSV column names).
Examples: data_field
header-field-typesboolean (bool)Field containing header has types specified (with name:type format).
header-field-on-changeboolean (bool)With ‘header-field`, only write out headers if columns change.
null-valuestringA subSstitute string value to be used in the event that a field is null.

Mode - Csv Fields

FieldTypeRequiredDescription
relaxed-schemaboolean (bool)
headerboolean (bool)
gen-headersboolean (bool)
autoconvertboolean (bool)
fieldsmap (string)
field-filepath (string)Examples: /path/to/file, c:\users\joe\data\file.txt
header-fieldsHeader Fields

Mode - Key Value Fields

FieldTypeRequiredDescription
autoconvertboolean (bool)
key-value-delimstring
multipleMultipleAllowed values: first, last, array

Mode - Events Fields

FieldTypeRequiredDescription
output-split-fieldfield (string)Examples: data_field
skip-listregex[] (string)JSON Pointer patterns (regex) to skip flattening when splitting events.
Examples: \d+[A-Z]*
exclude-non-empty-arraysboolean (bool)

Mode - Xml Fields

FieldTypeRequiredDescription
arraysstring[]List of fields in an xml payload to be expanded into separate events.

Mode - Csv - Fields Table

FieldType
event.fieldstr

Key format: field.

Mode - Multiline Table

FieldRegex
event.field^pattern$

Key format: field. Value format: regex.

Mode - Key Value - Multiple Options

ValueDescription
firstFirst
lastLast
arrayArray