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.

FormatString Example
ANSICMon Jan _2 15:04:05 2006
UnixDateMon Jan _2 15:04:05 MST 2006
RubyDateMon Jan 02 15:04:05 -0700 2006
RFC82202 Jan 06 15:04 MST
RFC822Z02 Jan 06 15:04 -0700
RFC850Monday, 02-Jan-06 15:04:05 MST
RFC1123Mon, 02 Jan 2006 15:04:05 MST
RFC1123ZMon, 02 Jan 2006 15:04:05 -0700
RFC33392006-01-02T15:04:05Z07:00
RFC3339Nano2006-01-02T15:04:05.999999999Z07:00
Kitchen3:04PM
StampJan _2 15:04:05
StampMilliJan _2 15:04:05.000
StampMicroJan _2 15:04:05.000000
StampNanoJan _2 15:04:05.000000000
DateTime2006-01-02 15:04:05
DateOnly2006-01-02
TimeOnly15: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.

FormatExample
seconds1713388128
milliseconds1713387762150

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