Monday, December 3, 2018

How to capture the Inbound REST logs and the associated REST Request Body in the Service Now system logs.

Steps to Debug Inbound REST API Calls in Service Now:



1.    Make sure the property “glide.rest.debug” is set to true under sys_properties table.




2. Get the REST request URL and the user_id of the user with which the REST call is coming to instance.

REST Request URL à https://******.service-now.com/api/now/table/incident

userid à  mychartintegration

3. Log onto instance and navigate to the Transactions under System Logs.
Search for the user_id in created by field and REST request URL in URL field (eg. for REST URL - https://nychhcdev.service-now.com/api/now/table/incident look for "/api/now/table/incident" in the URL field of transaction logs)


4.  Note the Ticket created time for which ticket  you are facing issue and open that particular transaction log from transactions above.
Ticket created à 12/04/2018 11:07:25



5. Find the transaction from above and note the value in System ID (node name) and Session ID fields of the identified transaction.
If you don’t find system ID, configure Form layout and add the field on the form.

System id à *************************
Session ID à *************************

6.    Navigate to the stats page to find the node you are logged in. (Check 2nd line on the page which says - Connected to cluster node and note the node name) https://nychhcdev.service-now.com/stats.do

Cluster node à *****************************

7. If Cluster node and System ID are same from 5 and 6 steps above:
n   Then, it’s easy to debug.
n  Open Node Log File Browser under System Logs and copy Session ID and Change Start time and End time to ticket creation time approximately.
n  You will see the Incoming Request Body  here with the clear incoming request.




8.  If Cluster node and System ID are different from 5 and 6 steps above:
n  Then, Go to Node Log File Download under System Logs and download localhost log for the day when the request was made to the instance.


9) Once you download the correct logs from STEP 8, open with Windows Wordpad Application and do a "search" on the log file using the Session ID identified in Step 5.

10) The Session logs which will be obtained from the filtered logs in step 9 will have the Request body in the logs which is sent to ServiceNow.


No comments:

Post a Comment

Discovery troubleshooting | Error messages

  Discovery troubleshooting | Error messages - Support and Troubleshooting (servicenow.com) Description Learn how to resolve common Discover...