Enrichments
Overview
Enrichments add new information to event payloads from the server. This transformation type supplements events with information that may be necessary within a downstream vendor.
Enrichment Types
Date
Generates a date or datetime string using the current server’s time. The date format argument requires Go’s formatting dialect. Find your desired format, copy the corresponding String Example, and paste it into the "format" box.
Format | String Example |
---|---|
ANSIC | Mon Jan _2 15:04:05 2006 |
UnixDate | Mon Jan _2 15:04:05 MST 2006 |
RubyDate | Mon Jan 02 15:04:05 -0700 2006 |
RFC822 | 02 Jan 06 15:04 MST |
RFC822Z | 02 Jan 06 15:04 -0700 |
RFC850 | Monday, 02-Jan-06 15:04:05 MST |
RFC1123 | Mon, 02 Jan 2006 15:04:05 MST |
RFC1123Z | Mon, 02 Jan 2006 15:04:05 -0700 |
RFC3339 | 2006-01-02T15:04:05Z07:00 |
RFC3339Nano | 2006-01-02T15:04:05.999999999Z07:00 |
Kitchen | 3:04PM |
Stamp | Jan _2 15:04:05 |
StampMilli | Jan _2 15:04:05.000 |
StampMicro | Jan _2 15:04:05.000000 |
StampNano | Jan _2 15:04:05.000000000 |
DateTime | 2006-01-02 15:04:05 |
DateOnly | 2006-01-02 |
TimeOnly | 15:04:05 |
Direct Value
Direct Values can be used for setting a specific value for the enriched output key. Your Direct Value’s data type can either be a String, Boolean, Integer, or Float.
Pseudo-Random Values
Random values can be generated as integers or floats (both accept min and max parameters).
Timestamp
The Timestamp enrichment uses the current server’s time to generate an output key value as a unix timestamp. The output is an Integer and can either be formatted to include milliseconds or seconds. Include either “seconds” or “milliseconds” as the value.
Format | Example |
---|---|
seconds | 1713388128 |
milliseconds | 1713387762150 |
UUID
The UUID option assigns a unique ID as the output key. You may select UUID v1 or UUID v4 to generate your ID. We recommend using UUID v4 to ensure IDs are not duplicated. Include either “v1” or “v4” as the value.
Additional Considerations
Adding Enrichments via Playbook Code
There are additional enrichment possibilities when adding enrichments within a playbook file. The following code provides examples of how enrichments can be added within playbook code:
enrichments:
- outputKey: event.name
staticString: purchase
- outputKey: event.params.currency
staticString: "USD"
- outputKey: event.event_date
date:
format: Mon, 02 Jan 2006 15:04:05 MST
- outputKey: event.event_delivery_ts
timestamp: milliseconds
- outputKey: event.event_rand
randomInt32:
min: 15
max: 45000
- outputKey: event.event_uuid
uuid: v4
staticString
values will be added as quoted strings in the outbound payload, regardless of the use of quotes in the Enrichment itself.
Enrichments can be set to the following data types:
staticString
staticInt
staticFloat
staticBool
randomFloat
randomInt32
uuid
timestamp
date
Updated 8 months ago