Business rule not working on syslog (Logs) table

dhony
Tera Contributor

Hi ,

I want to write   a business rule on syslog table , Actually requirement is capture backgroundscript   related logs and move them into new custom table.

i created business rule setting filter condtion it is working when log created manually   but it is not working when logs created by system.See below screen shots

Capture1.PNG

Capture2.PNG

Chuck Tomasi's Blog

1 ACCEPTED SOLUTION

saikrishnayanam
Kilo Expert

Direct Business rules not triggered for Logs.

Use Scheduled jobs to get log records instead of Businessrules.

View solution in original post

14 REPLIES 14

sergiu_panaite
ServiceNow Employee
ServiceNow Employee

Ok, so you only want BackgroundScripts, let me do a quick test on my own instance.


Yes.


I want only Background script logs ..and have to store in another table.





Thanks


Dhony.


Hi Sergiu,



Any update for   my query?


sergiu_panaite
ServiceNow Employee
ServiceNow Employee

Sorry for late reply. I did the testing and indeed it's not working via a BR on syslog. My understanding so far based on my tests is that transactions from Background Scripts do not triggers business rules. That is why inserting manually a row in syslog triggers the BR but not when running a script via Background Scripts.



So rather than doing a BR like that, you could probably get away with having a scheduled job to run every hour and collect all Background Scripts records from syslog directly.


dhony sergiu.panaite



Hi guys,



A couple of pointers that i'm sure will be helpful:



a) background script does trigger business rules. This important and key. Lets keep in mind business rules enforces aspects like business logic, data consistency, security, etc... so, yes... indeed business rules are triggered regardless on how the operation gets executed (manually, background script, web service, etc...)



b) insert/update business rules over the system log table will never run. I believe this is by design due to the high amount of entries that could exist within the log table, an insert/update business rule could easily create a significant performance impact over your instance. I personally believe ServiceNow should stop users from creating insert/update BRs over the syslog table, but life is not perfect , so although you actually can create one, internally ServiceNow will halt any insert/update BR for the syslog table.



Thanks,


Berny