Skip to main content

Adding Fields

Add event fields with the add action.

New Fields

name: example-add-fields

input:
echo:
json: true
event: |
{"initialField": "initialValue"}

actions:
- add:
fields:
- newField: newValue
- anotherNewField: newValue

output:
print: STDOUT

# output:
# {
# "initialField": "initialValue",
# "newField": "newValue",
# "anotherNewField": "newValue"
# }

Overwrite Fields

By default, add won't overwrite existing fields. This behaviour can be changed:

name: example-overwrite-fields

input:
echo:
json: true
event: |
{"initialField": "initialValue"}

actions:
- add:
overwrite: true
fields:
- initialField: newValue

output:
print: STDOUT

# output:
# {"initialField": "newValue"}