Convert
Convert (convert)
Section titled “Convert (convert)”Convert fields from one type to another, supporting simple and unit conversions Convert fields from one type to another, e.g. strings to numbers.
Transform json
Minimal example
Section titled “Minimal example”actions: - convert: {}JSON
{ "actions": [ { "convert": {} } ]}Contents
Section titled “Contents”A ✓ marks a field that accepts a context variable such as
{{ VARIABLE }}.
Behaviour
Section titled “Behaviour”Behaviour
| Field | Type | Required | Description |
|---|---|---|---|
auto ✓ |
boolean (bool) |
Allows auto-conversion, which helps when there are many fields. Default: false |
|
null-behaviour |
Null Behaviour |
Controls what occurs when a field’s value is null or empty. Allowed values: keep, default |
|
suppress-warnings ✓ |
boolean (bool) |
Suppress warnings generated by this action. Default: false |
Formatting
Section titled “Formatting”Formatting
| Field | Type | Required | Description |
|---|---|---|---|
format |
Format |
Apply a predefined format template before conversion. Allowed values: currency, percent, comma-number, plain |
|
preprocess |
Preprocess[] |
Preprocess operations applied before conversion. Allowed values: trim, strip-whitespace, remove-currency-literal, remove-percent-literal, remove-thousands-separator |
|
on-error |
On Error |
Behaviour when conversion fails. Allowed values: warn, default, drop |
General
Section titled “General”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() |
Mappings
Section titled “Mappings”Mappings
| Field | Type | Required | Description |
|---|---|---|---|
conversions |
Conversions[] |
Simple conversions. | |
units |
Units[] |
Unit conversions. |
Schema
Section titled “Schema”- Conversions Fields
- Units Fields
- Null Behaviour Options
- Format Options
- Preprocess Options
- On Error Options
- Conversions - Conversion Options
- Units - To Options
- Units - From Options
Conversions Fields
Section titled “Conversions Fields”| Field | Type | Required | Description |
|---|---|---|---|
field |
string |
✅ | event field to be converted in-place. |
conversion |
Conversion |
✅ | conversion operation. Allowed values: str, num, json, bytes-to-string, bool, array, split, csv-to-array, ssv-to-array, tsv-to-array, … |
Units Fields
Section titled “Units Fields”| Field | Type | Required | Description |
|---|---|---|---|
field |
string |
✅ | event field to be converted in-place. |
to |
To |
✅ | the unit we are converting to. Allowed values: bits, bits-per-second, bytes, bytes-per-second, days, exabytes, gibibytes, gibits, gigabits, gigabits-per-second, … |
from |
From |
optional unit we are converting from. Allowed values: bits, bits-per-second, bytes, bytes-per-second, days, exabytes, gibibytes, gibits, gigabits, gigabits-per-second, … |
Null Behaviour Options
Section titled “Null Behaviour Options”| Value | Aliases | Name | Description |
|---|---|---|---|
keep |
keep | Pass through null or empty values |
|
default |
default | Convert bool fields to false, num fields to 0 or str fields to an empty string |
Format Options
Section titled “Format Options”| Value | Aliases | Name | Description |
|---|---|---|---|
currency |
currency | ||
percent |
percent | ||
comma-number |
comma-number | ||
plain |
plain |
Preprocess Options
Section titled “Preprocess Options”| Value | Aliases | Name | Description |
|---|---|---|---|
trim |
trim | ||
strip-whitespace |
strip-whitespace | ||
remove-currency-literal |
remove-currency-literal | ||
remove-percent-literal |
remove-percent-literal | ||
remove-thousands-separator |
remove-thousands-separator |
On Error Options
Section titled “On Error Options”| Value | Aliases | Name | Description |
|---|---|---|---|
warn |
warn | ||
default |
default | ||
drop |
drop |
Conversions - Conversion Options
Section titled “Conversions - Conversion Options”| Value | Aliases | Name | Description |
|---|---|---|---|
str |
str | ||
num |
num | ||
json |
json | ||
bytes-to-string |
bytes-to-string | ||
bool |
bool | ||
array |
array | ||
split |
split | ||
csv-to-array |
csv-to-array | ||
ssv-to-array |
ssv-to-array | ||
tsv-to-array |
tsv-to-array | ||
null |
null | ||
url |
url | ||
auto |
auto |
Units - To Options
Section titled “Units - To Options”| Value | Aliases | Name | Description |
|---|---|---|---|
bits |
bits | ||
bits-per-second |
bits-per-second | ||
bytes |
bytes | ||
bytes-per-second |
bytes-per-second | ||
days |
days | ||
exabytes |
exabytes | ||
gibibytes |
gibibytes | ||
gibits |
gibits | ||
gigabits |
gigabits | ||
gigabits-per-second |
gigabits-per-second | ||
gigabytes |
gigabytes | ||
gigabytes-per-second |
gigabytes-per-second | ||
hours |
hours | ||
kibibytes |
kibibytes | ||
kibits |
kibits | ||
kilobits |
kilobits | ||
kilobits-per-second |
kilobits-per-second | ||
kilobytes |
kilobytes | ||
kilobytes-per-second |
kilobytes-per-second | ||
mebibytes |
mebibytes | ||
megabits |
megabits | ||
megabits-per-second |
megabits-per-second | ||
megabytes |
megabytes | ||
megabytes-per-second |
megabytes-per-second | ||
mibits |
mibits | ||
microseconds |
microseconds | ||
milliseconds |
milliseconds | ||
minutes |
minutes | ||
nanoseconds |
nanoseconds | ||
petabytes |
petabytes | ||
seconds |
seconds | ||
tebibytes |
tebibytes | ||
terabits |
terabits | ||
terabits-per-second |
terabits-per-second | ||
terabytes |
terabytes | ||
terabytes-per-second |
terabytes-per-second | ||
tibits |
tibits |
Units - From Options
Section titled “Units - From Options”| Value | Aliases | Name | Description |
|---|---|---|---|
bits |
bits | ||
bits-per-second |
bits-per-second | ||
bytes |
bytes | ||
bytes-per-second |
bytes-per-second | ||
days |
days | ||
exabytes |
exabytes | ||
gibibytes |
gibibytes | ||
gibits |
gibits | ||
gigabits |
gigabits | ||
gigabits-per-second |
gigabits-per-second | ||
gigabytes |
gigabytes | ||
gigabytes-per-second |
gigabytes-per-second | ||
hours |
hours | ||
kibibytes |
kibibytes | ||
kibits |
kibits | ||
kilobits |
kilobits | ||
kilobits-per-second |
kilobits-per-second | ||
kilobytes |
kilobytes | ||
kilobytes-per-second |
kilobytes-per-second | ||
mebibytes |
mebibytes | ||
megabits |
megabits | ||
megabits-per-second |
megabits-per-second | ||
megabytes |
megabytes | ||
megabytes-per-second |
megabytes-per-second | ||
mibits |
mibits | ||
microseconds |
microseconds | ||
milliseconds |
milliseconds | ||
minutes |
minutes | ||
nanoseconds |
nanoseconds | ||
petabytes |
petabytes | ||
seconds |
seconds | ||
tebibytes |
tebibytes | ||
terabits |
terabits | ||
terabits-per-second |
terabits-per-second | ||
terabytes |
terabytes | ||
terabytes-per-second |
terabytes-per-second | ||
tibits |
tibits |