Skip to content

Extract

Extract fields from text using regular expressions.

Transform json

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

A ✓ marks a field that accepts a context variable such as {{ VARIABLE }}.

General
Field Type Required Description
description string describe this step.
condition lua-expression (string) Only run this action if the specified condition is met.
Examples: 2 * count()
Input
Field Type Required Description
input-field field (string) The field containing the text.
Default: _raw
Examples: data_field
Mapping
Field Type Required Description
output-fields string[] field names to match with each matched group.
convert map (string) Optionally convert these fields afterwards. If fields is omitted, the keys from convert are used as the extracted field names.
Output
Field Type Required Description
remove boolean (bool) Remove field containing text afterwards.
Default: false
Pattern
Field Type Required Description
pattern regex (string) Pattern containing named groups. Default is to use the group names.
Examples: \d+[A-Z]*
Substitution
Field Type Required Description
output-pattern string Optionally, do a substitution using text containing $1, $2, etc. referring to captured groups.
output-field field (string) Write to this field if doing a substitution.
Examples: data_field
Warnings
Field Type Required Description
suppress-warnings boolean (bool) Suppress warnings generated by this action.
Default: false
drop boolean (bool) Don’t pass through failed matches.
Default: false
Field Type
event.field str

Key format: field.