---
sourceDocument: Zurich IT Operations Management
sourceDocumentLink: https://www.servicenow.com/docs/r/zurich/it-operations-management

 Release :

    - zurich

ft:locale :

    - en-US

ft:publication_title :

    - Zurich IT Operations Management

ft:clusterId :

    - itom

bundleId :

    - itom

workflow :

    - Technology


---

# Event collection from custom payloads

# Event collection from custom payloads {#ariaid-title1}

* Release version: Zurich
* 
* Updated July 31, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The MID WebService Event Collector enables you to collect event information from
custom payloads in JSON, XML, or plain text format.

## Before you begin

Ensure that the Event Management Connectors (sn_em_connector) plugin is
installed on the ServiceNow AI Platform instance.

Role required: evt_mgmt_admin

## About this task

The MID Server transforms the collected event messages and populates
the Event table fields (em_table) in the instance. The collection of formatted event
messages is described in this procedure using basic authentication. For information
about supported authentication methods, see [Configure the MID Web Server extension](https://www.servicenow.com/docs/RPQvfJbpCp6qgI_dATuFRg "The MID Web Server is a MID Server extension that enables developing REST APIs to send events and metrics to the MID Server. The extension is leveraged by other MID Server extensions, such as Metric Intelligence, MID WebService Event Listener, and the Agent Client Collector websocket endpoint extension.").

The format of the required MID Server URL is:
<kbd class="ph userinput">http://{MID_Server_IP}:{MID_Web_Server_Port}/api/mid/em/inbound_event?Transform={Transform_script_name}</kbd>.
The name of the MID Server
script include is composed by appending a suffix to the default
`TransformEvents_` prefix. For information about the collection
of JSON v2 event messages, see [Configure the MID WebService Event Collector Context](https://www.servicenow.com/docs/xz_3EnP5twMrVy9mNuOSIQ "Configure the MID WebService Event Collector Context to provide a URL method to push event messages from an external source to the MID Server.").  
Note:  
The URL in the format `http://{MID_Server_IP}:{MID_Web_Server_Port}/api/mid/em/{transform_script_name}`is also supported.

## Procedure

1. Configure the MID WebService Event Collector, see [Configure the MID WebService Event Collector Context](https://www.servicenow.com/docs/xz_3EnP5twMrVy9mNuOSIQ "Configure the MID WebService Event Collector Context to provide a URL method to push event messages from an external source to the MID Server.").
2. Start the MID WebService Event Collector.
{#event-collection-custom-payloads__steps_w5d_clp_ky}

## Example

Transformation of XML formatted event messages using the custom payload URL

Assume that XML formatted event messages are sent to the MID Server. Use this example to return an array of event objects from
the collected event messages. The name of the MID Server script
include is composed by appending a suffix to the default
`TransformEvents_` prefix. For the purposes of this example, the
user supplied the xmlSample script include. Using these details, the name of the MID Server script include is
`TransformEvents_xmlSample`. The MID Server
transforms the collected event messages by parsing the messages using the script
include and then transmitting them to the instance.
{#event-collection-custom-payloads__table_bqc_llp_ky__entry__2}

| Field | Value |
|-|-|
| MID_Server_IP | 10.218.64.27 |
| MID_Web_Server_Extension_Port | 8097 |
| transform_script_suffix _name | xmlSample |
[Table 1. Data for the XML example]

{#event-collection-custom-payloads__table_bqc_llp_ky}

Replace the variables in the URL with the values from the above table:
`http://10.218.64.27:8097/api/mid/em/xmlSample`  
Note:  
When copying and pasting the text below, hidden characters might also be copied and can cause unexpected results.

Example showing XML formatted event
messages:

    <records>
        <event>
        <source>My Source</source>
        <node>host1</node>
        <type>type1</type>
        <severity>3</severity>
        <description>Virtual memory usage exceeds 98%</description>
        </event>
        <event>
        <source>My Source</source>
        <node>host2</node>
        <type>type2</type>
        <severity>2</severity>
        <description>Virtual memory usage exceeds 90%</description>
        </event>
        </records>

**Related tasks**   

* [Configure the MID Web Server extension](https://www.servicenow.com/docs/RPQvfJbpCp6qgI_dATuFRg "The MID Web Server is a MID Server extension that enables developing REST APIs to send events and metrics to the MID Server. The extension is leveraged by other MID Server extensions, such as Metric Intelligence, MID WebService Event Listener, and the Agent Client Collector websocket endpoint extension.")
* [Configure the MID WebService Event Collector Context](https://www.servicenow.com/docs/xz_3EnP5twMrVy9mNuOSIQ "Configure the MID WebService Event Collector Context to provide a URL method to push event messages from an external source to the MID Server.")

