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
JSON
Contents
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
| 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
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
Mappings
| Field | Type | Required | Description |
|---|
conversions | Conversions[] | | Simple conversions. |
units | Units[] | | Unit conversions. |
Schema
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
| 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
| Value | 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 |
| Value | Name | Description |
|---|
currency | currency | Currency |
percent | percent | Percent |
comma-number | comma-number | Comma Number |
plain | plain | Plain |
Preprocess Options
| Value | Name | Description |
|---|
trim | trim | Trim |
strip-whitespace | strip-whitespace | Strip Whitespace |
remove-currency-literal | remove-currency-literal | Remove Currency Literal |
remove-percent-literal | remove-percent-literal | Remove Percent Literal |
remove-thousands-separator | remove-thousands-separator | Remove Thousands Separator |
On Error Options
| Value | Name | Description |
|---|
warn | warn | Warn |
default | default | Default |
drop | drop | Drop |
Conversions - Conversion Options
| Value | Name | Description |
|---|
str | str | Str |
num | num | Num |
json | json | Json |
bytes-to-string | bytes-to-string | Bytes To String |
bool | bool | Bool |
array | array | Array |
split | split | Split |
csv-to-array | csv-to-array | Csv To Array |
ssv-to-array | ssv-to-array | Ssv To Array |
tsv-to-array | tsv-to-array | Tsv To Array |
null | null | Null |
url | url | Url |
auto | auto | Auto |
Units - To Options
| Value | Name | Description |
|---|
bits | bits | Bits |
bits-per-second | bits-per-second | Bits Per Second |
bytes | bytes | Bytes |
bytes-per-second | bytes-per-second | Bytes Per Second |
days | days | Days |
exabytes | exabytes | Exabytes |
gibibytes | gibibytes | Gibibytes |
gibits | gibits | Gibits |
gigabits | gigabits | Gigabits |
gigabits-per-second | gigabits-per-second | Gigabits Per Second |
gigabytes | gigabytes | Gigabytes |
gigabytes-per-second | gigabytes-per-second | Gigabytes Per Second |
hours | hours | Hours |
kibibytes | kibibytes | Kibibytes |
kibits | kibits | Kibits |
kilobits | kilobits | Kilobits |
kilobits-per-second | kilobits-per-second | Kilobits Per Second |
kilobytes | kilobytes | Kilobytes |
kilobytes-per-second | kilobytes-per-second | Kilobytes Per Second |
mebibytes | mebibytes | Mebibytes |
megabits | megabits | Megabits |
megabits-per-second | megabits-per-second | Megabits Per Second |
megabytes | megabytes | Megabytes |
megabytes-per-second | megabytes-per-second | Megabytes Per Second |
mibits | mibits | Mibits |
microseconds | microseconds | Microseconds |
milliseconds | milliseconds | Milliseconds |
minutes | minutes | Minutes |
nanoseconds | nanoseconds | Nanoseconds |
petabytes | petabytes | Petabytes |
seconds | seconds | Seconds |
tebibytes | tebibytes | Tebibytes |
terabits | terabits | Terabits |
terabits-per-second | terabits-per-second | Terabits Per Second |
terabytes | terabytes | Terabytes |
terabytes-per-second | terabytes-per-second | Terabytes Per Second |
tibits | tibits | Tibits |
Units - From Options
| Value | Name | Description |
|---|
bits | bits | Bits |
bits-per-second | bits-per-second | Bits Per Second |
bytes | bytes | Bytes |
bytes-per-second | bytes-per-second | Bytes Per Second |
days | days | Days |
exabytes | exabytes | Exabytes |
gibibytes | gibibytes | Gibibytes |
gibits | gibits | Gibits |
gigabits | gigabits | Gigabits |
gigabits-per-second | gigabits-per-second | Gigabits Per Second |
gigabytes | gigabytes | Gigabytes |
gigabytes-per-second | gigabytes-per-second | Gigabytes Per Second |
hours | hours | Hours |
kibibytes | kibibytes | Kibibytes |
kibits | kibits | Kibits |
kilobits | kilobits | Kilobits |
kilobits-per-second | kilobits-per-second | Kilobits Per Second |
kilobytes | kilobytes | Kilobytes |
kilobytes-per-second | kilobytes-per-second | Kilobytes Per Second |
mebibytes | mebibytes | Mebibytes |
megabits | megabits | Megabits |
megabits-per-second | megabits-per-second | Megabits Per Second |
megabytes | megabytes | Megabytes |
megabytes-per-second | megabytes-per-second | Megabytes Per Second |
mibits | mibits | Mibits |
microseconds | microseconds | Microseconds |
milliseconds | milliseconds | Milliseconds |
minutes | minutes | Minutes |
nanoseconds | nanoseconds | Nanoseconds |
petabytes | petabytes | Petabytes |
seconds | seconds | Seconds |
tebibytes | tebibytes | Tebibytes |
terabits | terabits | Terabits |
terabits-per-second | terabits-per-second | Terabits Per Second |
terabytes | terabytes | Terabytes |
terabytes-per-second | terabytes-per-second | Terabytes Per Second |
tibits | tibits | Tibits |