Additional entity action configuration: Send to ServiceNow
Exposure Analytics has a built-in alert action for pushing asset records to ServiceNow. This action is useful for updating existing ServiceNow assets with accurate, complete asset data or adding unmanaged assets to ServiceNow so you can manage them appropriately.
cmdb_ci_server and cmdb_ci_computer. Predefined entity discovery sources are available for data pulled in through these inputs.
Configure the Send to ServiceNow alert action: Overview
Create an entity action for each import set that you push data to. For example, if you are pushing workstations and servers, create two entity actions and add the Send to ServiceNow alert action to each one.
To configure the Send to ServiceNow alert action, complete the following general steps. See separate sections under this list for details on each step.
-
Create an import set table and transform map in ServiceNow.
-
Enable the ServiceNow alert action.
-
Add your ServiceNow instances and import sets.
-
Add an entity action condition and map fields.
-
Add the alert action to the condition
Step 1: Create an import set table and transform map in ServiceNow
An import set table acts as a staging location for records imported from a data source before those records are transformed. The integration uses a REST API to send data to the import set table.
Create an import set table, then create a transform map in ServiceNow to convert the data in the import set table to another table according to the transform map rules.
Create an import set table:
-
In ServiceNow, select System Web Services, then Inbound, and then Create New.
-
Add the fields from the Exposure Analytics asset inventory that you want to include in ServiceNow.
Create a transform map:
-
In ServiceNow, select System Import Sets, then Create Transform Map.
-
Enter a name for the transform map.
-
Set the import set table as the Source table.
-
Select a Target table, such as
cmdb_ci_server. -
Select the Create a new record on empty coalesce fields check box if you want to create new asset records in the target table when the asset does not already exist.
-
Create the mapping from the import set source table to the target table.
Map the source fields to the target table:
-
Select System Import Sets, then Administration, and then Transform maps.
-
Select the transform map that you created.
-
In the Related Links section, select Mapping Assist.
-
Map the source fields from the import set table to the target table.
-
Select Save after all fields are mapped.
-
In the Field Maps table, find the source field to use as the key field for the data set. The key field uniquely identifies the asset in your ServiceNow environment. For example, it might be the hostname or serial number.
-
For that field, change the Coalesce column value to
true. -
Select Update to save the key field change.
Configure synchronous transformations to allow for multiple record updates:
-
Select System Web Services, then REST, and then Insert Multiple.
-
Select New, then enter a name.
-
Set the import set table you created as the source table.
-
Change the transformation to Synchronous.
-
Select Submit.
-
Select the row that you created.
-
In the Column mappings table, select New.
-
Select these values:
-
Type:
JSON -
Column mapping: Column name
-
-
Select Submit.
For more information about import set tables and transform maps, see the ServiceNow documentation on import sets.
u_serial_number, to increase the limit. For example, a VMware serial number can exceed 40 characters. If you do not increase the field limit before importing, ServiceNow records only the first 40 characters.
Step 2: Enable the ServiceNow alert action
The ServiceNow alert action is hidden by default and must be enabled.
To enable the ServiceNow alert action, complete the following steps:
-
Select Configure, then Exposure Analytics, and then Configuration settings.
-
Select the Default configurations tab.
-
Under Entity actions, change the ServiceNow action toggle to On.
You can also turn off the ServiceNow alert action by changing the ServiceNow action toggle to Off.
Step 3: Add ServiceNow instances and import sets
Add one or more ServiceNow instances and associated import sets to the ServiceNow configuration under Entity actions in Exposure Analytics. You can add and save multiple instances and import sets to send data to import set tables in different ServiceNow environments. For example, if you have an import set table in a test environment and another in a production environment, you can add both instances and send data to either one.
To add a ServiceNow instance and import set to the ServiceNow configuration, complete the following steps:
-
Select Configure, then Exposure Analytics, and then Entity actions management.
-
Select the ServiceNow configuration tab.
-
Select Add.
-
Enter a name for the ServiceNow instance so you can select it when configuring an alert action. For example, enter
Testfor a test instance. -
Enter the Instance URL. The URL must begin with
https://and must not include an additional path. For example,https://myserver.service-now.com.Note: Do not include the import set table name at the end of this URL. -
Enter the name of the import set table you want to use. For example, a table name might be
u_cmdb_ci_server.Note: The Full path URL is generated automatically and includes both the instance and the import set table. For example, an instance URL ofhttps://myserver.service-now.comand an import set table namedu_serversproduce the full path URLhttps://myserver.service-now.com/api/now/import/u_servers. -
Enter the username and password for the ServiceNow service account you created.
-
(Optional) Select Test connection before saving.
-
Select Save.
Repeat these steps for any additional ServiceNow instances or import set tables.
Step 4: Add an entity action condition and map fields
Follow the steps in Add an entity action to create an entity action condition. The condition will likely represent a subset of data that you want to send to ServiceNow. For example, you could create an asset record condition with a filter that finds servers seen on the network in the past day that are not in ServiceNow. This example assumes you are pulling data from ServiceNow as an entity discovery source.
In the Additional logic box of the entity action condition, add logic to ensure that the fields sent to ServiceNow match the fields expected by the import set table.
For example, the additional logic might look like this:
| rename nt_host AS u_host_name, vendor AS u_manufacturer, product AS u_model_id, asset_type AS u_sys_class_name, serial AS u_serial_number, user_id AS u_assigned_to, os AS u_os, os_version AS u_os_version, dns AS u_dns_domain, asset_class AS u_chassis_type, category AS u_short_description, mem AS u_ram, cpu_mhz AS u_cpu_speed, cpu_count AS u_cpu_count, cpu_cores AS u_cpu_core_count, city AS u_city, state AS u_state, country AS u_country, location_id AS u_location, lastdetect AS u_most_recent_discovery
| eval u_discovery_source="EA"
| fields u_*
| convert ctime(u_most_recent_discovery) timeformat="%Y-%m-%d %H:%M:%S"
In this example, fields in the ServiceNow import set table use the u_XXXX syntax. To find the field names needed for this search, select System Web Services in ServiceNow, then select your import set table and check the Name column.
After Preview displays the results in the required format, select Save to save the condition.
Step 5: Add the alert action to the condition
Follow the steps in Add an entity action to add the Send to ServiceNow alert action to the entity action condition you created.
After you select the Send to ServiceNow alert action, configure it as follows:
-
Instance: Select the ServiceNow instance with the import set table you want to send data to.
-
Key Field: Specify the field to use as the unique key. For example, you might use
u_host_nameif ServiceNow expects hostname as the unique key. -
Batch Size: Specify how many records to send at a time. Splunk Asset and Risk Intelligence sends data to ServiceNow in batches.
Note: The batch size must be between 2 and 200. -
Debug: Enable debug logging output from the alert action. Leave this field unchecked unless you need to troubleshoot an issue.
-
Filter Blanks: Specify whether to send empty values to ServiceNow. Set this option to Off if you do not want to send empty values.
-
Dry Run: Run all Send to ServiceNow steps except pushing the asset data to ServiceNow. Use this option to validate authentication.
-
Select Add action when configuration is complete.
After you configure and add the alert action, assets are sent to ServiceNow the next time the entity action runs. You cannot run the action manually.
To force the search to run, schedule the entity action condition to run in two minutes, save it, and let it run the alert action. After you validate everything, change the schedule to a more suitable time and frequency.
Troubleshoot the ServiceNow alert action
In Exposure Analytics, monitor configured searches that use the ServiceNow alert action on the ServiceNow sync summary dashboard. To open the dashboard, select Analytics, then Exposure Analytics, and then Exposure Analytics diagnostics.
Select the ServiceNow summary tab on the diagnostics dashboard. The tab contains the following data:
| Dashboard panel | Description |
|---|---|
| Executions by time | The number of times the ServiceNow sync alert action has run in the past 24 hours. |
| Errors and warnings by time | The number of errors and warnings from the ServiceNow alert action in the past 24 hours. |
| Sync results by time | The search run results from the ServiceNow alert action in the past 24 hours. |
| Alert logs | The log events output from the ServiceNow alert action in the past 24 hours. You can filter this event list by log level. |