How can i extract report from Sys Audit table along with the Incident records(not the sys id's).

Jayant Balyan1
Tera Contributor

I want to extract report from Sys audit table and compare it with the changes made on Incidents. Sys audit table has sys id for those incidents. How can i extract file/report with the Incident numbers.

Thanks.

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

You need to create a Database view for 

sys_audit & incident table. 

find_real_file.png

Once done you can report on number instead of Document key.

Can you one such need as it is not ideal to report on audit & other tables not because of security but tons of data it holds.

View solution in original post

16 REPLIES 16

Sulabh Garg
Mega Sage
Mega Sage

Hello Jayant,

There is no easy way to do this. 

First you have to extract (export) the records from sys_audit table and then you need to take all the sys_id's extracted and find the corresponding Incident number. You can do this by creating the database view on Incident table and create a report on it and then apply the condition on report (sys id is one of <enter all sys_id's> ) then you will be able to find the sys id and corresponding incident number and then export the report.  (you cannot find the Incident number and sys_id from list view of Incidents as sys_id will not come after export).

And then apply the vlookup on your first extracted report and then you can find the corresponding Incident number with sys_id.

 

 

Please Mark ✅ Correct/helpful, if applicable, Thanks!! 

Regards

Sulabh Garg

Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

Thanks Sulabh.

Thanks Jayant for marked my response as correct, Prefer not to create database view on "sys_audit" table as it will result into performance issues.

 

Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

@Sulabh Garg  no need to do a vlookup. Database view in ServiceNow itself will suffice the need.

Yes, But I don't prefer to create a database view on sys_audit table for obvious reasons. In my approach database view can only be created on Incident table to get the sys_id's.

Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg