[FEATURE] Add option to skip audit log in system.tag.write functions

I need to add previous value into the audit log, so I essentially need to create my own wrapper functions for the two system.tag.write* functions and insert my own entries into the audit log table to which I’ve added a new ACTION_VALUE_PREVIOUS field. These functions both write into the audit log though which I would like to be able to skip, like is possible with the system.db.*Update functions.

PS. I already have a feature suggestion for actually recording the previous values by default, but I assume adding a simple skipAudit argument to the existing function would be far simpler

Vote here:

Vote here for storing previous value by default:

1 Like

If you do your writes from a gateway context I believe they skip the auditing system. So you could make your wrapper use sendRequest.

I think we just route them to a [potentially] different audit profile based on Config -> Security -> General setting for Gateway Audit Profile:

Am I incorrect in thinking that a gateway timer script defined in my project also executes in the gateway context? Since upgrading to 8.1.18 all my timer scripts that use system.tag.write are logging to the audit log for my project. This is a regression for our system.

That is correct, as well as anything that occurs in any other type of Gateway Event, a perspective script, or tag value change scripts.

Writing into the audit log was an inherent bug in previous versions where system.tag.write* functions would not write into the audit log. Also FYI, every script that runs in Perspective runs in the gateway context, so user actions in Perspective that were written via script would also not be written to the audit log (very bad), where now they are. However, I did start an idea for exactly your use-case where you don’t want to write into the log:

Another use case for this Idea:

If you write tag dataset with large value, for example when yau want to make cache data, you will reveive error and need to increase the action_value db field to avoid it.

You dont want those cache data in audit logs.
A skip option would be suitable

I've again arrived at requiring this option to stop flooding an audit log with 100's of records every few seconds due to tag writes to 100's of tags in a gateway script which updates alarm summary tags. The audit table is 136GB at the moment, and the majority of this is all this crap :confused: With no way to skip auditing of these tag writes, I'm not sure what good option I have. I could run a DELETE statement periodically to purge the table of the records after the fact, but that seems silly

2 Likes