Skip to content

Extract

Extract (extract)

Extract fields from text using regular expressions.

Transform json

Minimal example

actions:
- extract:
pattern: ""
JSON
{
"actions": [
{
"extract": {
"pattern": ""
}
}
]
}

Contents

Fields

FieldTypeRequiredDescription
pattern Patternregex (string)Pattern containing named groups. Default is to use the group names.
Examples: \d+[A-Z]*
description Generalstringdescribe this step.
condition Generallua-expression (string)Only run this action if the specified condition is met.
Examples: 2 * count()
input-field Inputfield (string)The field containing the text.
Examples: data_field
remove Outputboolean (bool)Remove field containing text afterwards.
suppress-warnings Warningsboolean (bool)Suppress warnings generated by this action.
drop Warningsboolean (bool)Don’t pass through failed matches.
output-fields Mappingstring[]field names to match with each matched group.
convert Mappingmap (string)Optionally convert these fields afterwards. If fields is omitted, the keys from convert are used as the extracted field names.
output-pattern SubstitutionstringOptionally, do a substitution using text containing $1, $2, etc. referring to captured groups.
output-field Substitutionfield (string)Write to this field if doing a substitution.
Examples: data_field

General

Show fields
FieldTypeRequiredDescription
descriptionstringdescribe this step.
conditionlua-expression (string)Only run this action if the specified condition is met.
Examples: 2 * count()

Input

Show fields
FieldTypeRequiredDescription
input-fieldfield (string)The field containing the text.
Examples: data_field

Output

Show fields
FieldTypeRequiredDescription
removeboolean (bool)Remove field containing text afterwards.

Warnings

Show fields
FieldTypeRequiredDescription
suppress-warningsboolean (bool)Suppress warnings generated by this action.
dropboolean (bool)Don’t pass through failed matches.

Pattern

Show fields
FieldTypeRequiredDescription
patternregex (string)Pattern containing named groups. Default is to use the group names.
Examples: \d+[A-Z]*

Mapping

Show fields
FieldTypeRequiredDescription
output-fieldsstring[]field names to match with each matched group.
convertmap (string)Optionally convert these fields afterwards. If fields is omitted, the keys from convert are used as the extracted field names.

Substitution

Show fields
FieldTypeRequiredDescription
output-patternstringOptionally, do a substitution using text containing $1, $2, etc. referring to captured groups.
output-fieldfield (string)Write to this field if doing a substitution.
Examples: data_field

Schema

Convert Table

FieldType
event.fieldstr

Key format: field.