You can use a web service interface, supported by ServiceNow, that operates on the JSON object as the data input and output format.

Before you begin

Role required: evt_mgmt_integration

About this task

To insert records in the event [em_event] table with a single call, use this web service API:

https://<instancename>.service-now.com/api/global/em/jsonv2

Note: Business rules on the event table are not invoked when this URL is used.

Do not add additional fields to an event by adding a custom field to the event table [em_event]. However, additional fields should be included in the Additional information [additional_info] field of the event. For more information about how to include additional fields in events, see Custom alert fields.

The URL in the format: http://<instancename>.service-now.com/em_event.do?JSONv2&sysparm_action=insertMultiple is also supported in case you do want to activate Business rules. However, the performance of the first URL is superior.

To work with the URL that ends with =insertMultiple, add the following properties, with their respective values, to the MID Server:
  • "mid.probe.event.queue.compress" - value: false
  • "mid.probe.event.bulk_size" - value: 100
  • "mid.probe.event.endpoint.url" - value: em_event.do?JSONv2%26sysparm_action=insertMultiple

Procedure

  1. Send the request with these headers:
    Parameter Type Description
    Accept String The acceptable type for this message.

    The default value is application/json.

    Content-Type String The content type for this message.

    The default value is application/json.

    POST String The request type is POST, with one or more trailing records.
  2. One or more events in JSON format can be sent as the payload of the web service call.
    Event fields that should be populated are:
  3. To create multiple records with a single call, trigger the event web service using the following URL, where the <instance name> variable is replaced with the name of the required instance:
    https://<instancename>.service-now.com/api/global/em/jsonv2
    Example showing the payload for two events that are sent in a single web service call:
    { "records":	
     [
      {
       "source":"SCOM",
       "event_class":"SCOM 2012 on scom.server.com",
       "resource":"D:",
       "node":"name.of.node.com",
       "metric_name":"Percentage Logical Disk Free Space",
       "type":"Disk space",
       "severity":"4",
       "description":"The disk D: on computer V-W2K8-abc.abc.com is running out of disk space. The value that exceeded the threshold is 38% free space.",
       "additional_info": '{"scom-severity":"Medium","metric-value":"38","os_type":"Windows.Server.2008"}'
       },
      {
       "source":"SCOM",
       "event_class":"SCOM 2012 on scom.server.com",
       "resource":"MSSQL-database-name",
       "node":"other.node.com",
       "metric_name":"DB Allocated Size (MB)",
       "type":"Database Storage",
       "severity":"3",
       "description":"High number of active connections for MSSQL-database-name running on name.of.node.com. Active connections exceed 5000.",
       "additional_info": '{"scom-severity":"Medium","metric-value":"38","os_type":"Windows.Server.2008"}'
      }
     ]
    }
  4. To create one record with a single call, trigger the event web service using the following URL, where the <instancename> variable is replaced with the name of the required instance:
    http://<instancename>.service-now.com/api/global/em/jsonv2
    Example showing the payload for one event that is sent in a single web service call:
    { "records":	
     [
      {
       "source":"SCOM",
       "event_class":"SCOM 2007 on scom.server.com",
       "resource":"C:",
       "node":"name.of.node.com",
       "metric_name":"Percentage Logical Disk Free Space",
       "type":"Disk space",
       "severity":"4",
       "description":"The disk C: on computer V-W2K8-dfg.dfg.com is running out of disk space. The value that exceeded the threshold is 41% free space.",
       "additional_info": '{"scom-severity":"Medium","metric-value":"38","os_type":"Windows.Server.2008"}'
      }     
     ]
    }