- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 12:07 AM
Hello Community,
I'm urgently trying to delete all records from the syslog table. Some runaway code flooded it with millions of entries, causing minutes pauses in the system. Sometimes even crashing it. It's such a mass it's meaningless to erase the rows one by one.
I'd like to run 'Delete all records' on the 'syslog' table. The button unfortunately isn't there. Despite having the 'admin' role.
What I've tried so:
- Remove the 'nobody' role for deletion => can not delete it. grayed out.
- Assign myself the 'nobody' role => no effect
- Include the 'nobody' role into the 'admin' role => no effect
Is there anything else I can try ?
thx !
Solved! Go to Solution.
- Labels:
-
Platform and Cloud Security
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 12:15 AM
Hi,
you can use fix script for that
Note: Please test this well before running for entire table
var rec = new GlideRecord('syslog');
rec.query();
rec.deleteMultiple();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 12:15 AM
Hi,
you can use fix script for that
Note: Please test this well before running for entire table
var rec = new GlideRecord('syslog');
rec.query();
rec.deleteMultiple();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 01:37 AM
Hi Ankur,
FYI, you don't need to do a query() before a deleteMultipe().
Have a look at the example at
https://developer.servicenow.com/dev.do#!/reference/api/orlando/server_legacy/c_GlideRecordAPI#r_GlideRecord-deleteMultiple
My modest contribution 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 01:57 AM
Thank you for correction.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 01:46 AM
Many thanks indeed for the speedy response !
Is it correct to run it in "scripts - background" ? The script seems to hang and the table doesn't seem to contain less records. Yet ?