Skip to main content

copyCEventToPayload

This action copies the entire CEvent object (event, alert, or Situation) as a JSON object into the appropriate workflowContext payload key for that object. This allows an exporter such as exportViaRest to run without the need to set up a Payload map beforehand.

By default, copyCEventToPayload copies the JSON to the “top” level of the payload. A receiver will see the standard event, alert, or Situation schema at the root level of the payload. Optionally, you can specify a key from the root to copy the JSON to.

Note

If both getPayload and copyCEventToPayload are used in the same workflow, you must run getPayload first. getPayload will overwrite any existing payload.

If both getPayload and copyCEventToPayload are used in the same workflow, and copyCEventToPayload is using the root object — i.e., no key is specified — then copyCEventToPayload will overwrite duplicate keys. For example, if a payload created by getPayload contains a “description” key, copyCEventToPayload will overwrite this value as the CEvent contains a “description” key of it’s own.

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 copyCEventToPayload takes the following arguments:

Name

Required

Type

Description

key

no

string

The key to copy the CEVent to under the root object.

Example

To copy the entire CEvent object to a named key under an existing payload:

  • getPayload

    mapName : <payload map name>

  • copyCEventToPayload

    key : original

  • exportViaRest

    endpointName : <rest endpoint>

The resulting payload would be a merge of both the payload from getPayload and the CEvent under the “original” key. The resulting payload in the workflow context would look like this:

{
    "payloads": {
        "2049": {
            "dedupe_key": "localhost::cpqSm2IrsCommFailure::A value for sysName::A value for cpqHoGUIDCanonical::A value for cpqSiSysSerialNum::A value for cpqSiProductName::1::A value for cpqSm2ErsRemoteHost:2049",
            "description": "This is a < > test",
            "check": "MOOG_TRAPD::SNMPTrapLAM",
            "severity": 0,
            "source": "A value for sysName",
            "service": [],
            "class": "server",
            "manager": "SNMPTrapLAM",
            "manager_id": "https://moog8/#/alerts?filtereditor=advanced&filter-query='Alert%20id'=2049",
            "tags": {
                "alert_id": 2049
            },
            "time": 1623845950,
            "custom_info": {
                "enrichment": {},
                "mooghandling": {
                    "archiveOnly": false,
                    "isEnriched": false
                },
                "eventDetails": {
                    "cpqSm2ErsRemoteHost": "A value for cpqSm2ErsRemoteHost",
                    "cpqHoTrapFlags": 1,
                    "cpqSm2ErsTransactionType": "registration",
                    "cpqSiProductName": "A value for cpqSiProductName",
                    "cpqSm2ErsConnectionModel": "insightOnline",
                    "cpqSiSysProductId": "A value for cpqSiSysProductId",
                    "cpqSiAssetTag": "A value for cpqSiAssetTag",
                    "sysName": "A value for sysName",
                    "cpqHoGUIDCanonical": "A value for cpqHoGUIDCanonical",
                    "cpqSiSysSerialNum": "A value for cpqSiSysSerialNum",
                    "cpqSm2ErsFailureCode": "genericTransmitError"
                },
                "ticketing": {
                    "ticketNumber": null,
                    "ticketStatus": null
                },
                "location": {},
                "services": [],
                "tags": []
            },
            "original": {
                "active_sig_list": [],
                "agent": "MOOG_TRAPD",
                "agent_location": "COMPAQ",
                "alert_id": 2049,
                "class": "server",
                "count": 2,
                "custom_info": {
                    "enrichment": {},
                    "mooghandling": {
                        "archiveOnly": false,
                        "isEnriched": false
                    },
                    "eventDetails": {
                        "cpqSm2ErsRemoteHost": "A value for cpqSm2ErsRemoteHost",
                        "cpqHoTrapFlags": 1,
                        "cpqSm2ErsTransactionType": "registration",
                        "cpqSiProductName": "A value for cpqSiProductName",
                        "cpqSm2ErsConnectionModel": "insightOnline",
                        "cpqSiSysProductId": "A value for cpqSiSysProductId",
                        "cpqSiAssetTag": "A value for cpqSiAssetTag",
                        "sysName": "A value for sysName",
                        "cpqHoGUIDCanonical": "A value for cpqHoGUIDCanonical",
                        "cpqSiSysSerialNum": "A value for cpqSiSysSerialNum",
                        "cpqSm2ErsFailureCode": "genericTransmitError"
                    },
                    "ticketing": {
                        "ticketNumber": null,
                        "ticketStatus": null
                    },
                    "location": {},
                    "services": [],
                    "tags": []
                },
                "description": "This is a < > test",
                "entropy": 1,
                "event_id": 15514,
                "external_id": "compaq::cpqSm2IrsCommFailure",
                "first_event_time": 1623845677,
                "int_last_event_time": 1623845950,
                "last_event_time": 1623845950,
                "last_state_change": 1623928448,
                "manager": "SNMPTrapLAM",
                "owner": 2,
                "rc_probability": null,
                "severity": 0,
                "sig_list": [],
                "signature": "localhost::cpqSm2IrsCommFailure::A value for sysName::A value for cpqHoGUIDCanonical::A value for cpqSiSysSerialNum::A value for cpqSiProductName::1::A value for cpqSm2ErsRemoteHost:2049",
                "significance": 3,
                "source": "A value for sysName",
                "source_id": "localhost::compaq::cpqSm2IrsCommFailure",
                "state": 9,
                "type": "cpqSm2IrsCommFailure"
            }
        }
    }
}