Skip to main content

convertCustomInfoToTags

A Workflow Engine function that works specifically with an alert export to Moogsoft Observability Cloud (MOC), and “flattens” a Moogsoft Onprem custom_info object into a single-depth key:value tags object suitable for ingestion by MOC Events or the Create Your Own Integration (CYOI) API.

  • All custom_info tags are flattened to a key:value pair.

  • All values must be strings or integers

    Source values in custom_info that are arrays (lists) are converted to strings.

    The only exception to this rule is a custom_info.labels array—this remains an array.

  • The flattened tags object is copied to the workflowContext for use by subsequent actions.

This function is available as a feature of the Add-ons v2.3.5 download and later.

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

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function convertCustomInfoToTags has no arguments.

Example

Given a deeply nested custom_info source object:

{ 
  "key1" : "value 1",
  "key2" : {
    "key4" : "value 4",
    "key5" : {
      "key6" : "value 6"
    }
  },
  "key3" : [ 1, 2, 3, 4, 5 ],
  "labels" : [ "ip=10.0.0.1", "device=Router"],
  "key7" : 99
}

The flattened workflowContext.tags object is:

{ 
  "key1" : "value 1"
  "key2.key4" : "value 4",
  "key2.key5.key6" : "value 6",
  "key3" : "[1, 2, 3, 4, 5 ]",
  "labels" : [ "ip=10.0.0.1", "device=Router"],
  "key7" : 99
}

NOTES

  • key3 had an array as a value and, after flattening this array, key3 is now a stringified version of this array.

  • labels remained an array after conversion.