Skip to main content

addDefaultCustomInfoValues

A Workflow Engine action that uses the Payloads integration to define a set of default values to add to an event, alert or Situation custom_info. The contents of the payload can use the full Payload macros in the definition, including fixed and substituted values. This makes it easier to move existing object values from a non-standard custom_info schema to a fixed schema.

This action supersedes the existing addDefaultValues which used the deprecated Payload Maps integration for the values.

This function is available as a feature of the Add-ons v2.1 download and later. See Install Moogsoft Add-ons for information on how to upgrade.

This function is available for event, alert, and Situation workflows.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function addDefaultCustomInfoValues takes the following arguments:

Name

Required

Type

Description

mapName

yes

string

The Payload map name defined in the Payloads integration tile.

key

yes

string

The destination key under custom_info key where you want to store the data.

Example

An event has a fixed schema containing the following custom_info:

"custom_info" { 
  "eventDetails" : {
    "eventSource" : "host123",
    "hostLocation" : "London"
    }
}

If you wanted to create a populated custom_info model including an empty list for “applications”:

"custom_info" { 
  "eventAttributes" {
    "location" : ...,,
    "hostname" : ....,
    "applications" : []
  },
  "eventDetails" : {
    ...
  }
}

You can define a Payload containing the following rules in the Payload and the addDefaultCustomInfoValues in an event workflow.:

location.png
hostname.png
applications.png

And the following arguments in the action:

  • mapName : defaults

  • key : custom_info.eventAttributes

The UI translates your settings to the following JSON:

{"mapName":"defaults","key":"custom_info.eventAttributes"}

Before running the event’s custom_info would be:

"custom_info": {
        "eventDetails": {
            "eventSource": "host123",
            "hostLocation": "London"
        }
    }

After running it would be:

"custom_info": {
        "eventDetails": {
            "eventSource": "host123",
            "hostLocation": "London"
        },
        "eventAttributes": {
            "location": "London",
            "hostname": "host123",
            "applications": []
        }
    }