[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

3 Likes

This really renders the audit log useless...

It's been TWO YEARS since @nminchin post that issue and it is still going on.

It's really the time for IA to do something about it
(make the audit log writes for tag.write* OPTIONAL).

1 Like

Out of interest, the table is 186GB now, after 4 months.
I just checked the latest 1000 entries, and they're all writes to things like alarm summary count tags and GAN monitoring tags.
The 1000 records span from:
2024-07-11 20:35:19.163
to:
2024-07-11 20:36:59.923
So 1min 40s. 10 Useless records a second... No wonder the table has 253,617,113 records!!

1 Like

Mine has 590000 records in just 4 days and 99.9% are tag writes... :man_facepalming: :rofl:

2 Likes

Hi,

I observed the below from my testing (running Perspective on 8.1.42).

  • Calling system.tag.writeBlocking() would insert new record(s) into audit logs' table.
  • Calling system.tag.write() would not.

I hope that someone can confirm the same observation from his/her end.
And that may be a workaround to 'skip audit log' for now.

Kind regards,

Because the function is depreciated and thus did not receive the update that writes to the audit log.

1 Like

Read this topic,

Hi,
I came to this thread because I think somewhere between version 8.1.24 and 8.1.42 a bug has been introduced about this issue.
Our project makes several tag writes through a gateway scripts (about 300 per second). Nowadays, after upgrading from 8.1.24 to 8.1.42, all fo those tag writes are being written to the auditing database.

Do you have any information about this behavior?
Thanks

If you follow and read the linked topic in the comment above yours, you will see that it is fixed in v8.1.43.

1 Like