# \[IGN-15680\]Way to audit named queries?

**URL:** <https://forum.inductiveautomation.com/t/ign-15680-way-to-audit-named-queries/114416>\
**Category:** Ignition\
**Tags:** vision, ignition81\
**Created:** [March 10, 2026, 2:55pm UTC](https://forum.inductiveautomation.com/t/ign-15680-way-to-audit-named-queries/114416 "2026-03-10T14:55:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [March 10, 2026, 2:55pm UTC](https://forum.inductiveautomation.com/t/ign-15680-way-to-audit-named-queries/114416/1 "2026-03-10T14:55:29Z")

</div>

Using 8.1.47 vision with auditing turned onto a database datasource.

I only just noticed this - queries run via `system.db.runPrepUpdate` queries gets audited in full to the audit log ie the full query itself is logged which is nice for seeing exactly what happened.

The same does not happen when running UPDATE/INSERT statements via `runNamedQuery` in fact I don’t see anything. I would have expected either the full query or even just the namedQueryPath and the params (though the full query would be preferred in case the named query definition was changed at some point).

Don’t know if I am missing something here about enabling the auditing on NQs but I didn’t see anything on the gateway audit configure page or the named query definition designer portion.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 10, 2026, 3:28pm UTC](https://forum.inductiveautomation.com/t/ign-15680-way-to-audit-named-queries/114416/2 "2026-03-10T15:28:10Z")

</div>

I don't see any auditing code around named query execution in 8.1 or 8.3 😬

We should probably fix that. I'm surprised no one has mentioned it before.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [March 10, 2026, 3:29pm UTC](https://forum.inductiveautomation.com/t/ign-15680-way-to-audit-named-queries/114416/3 "2026-03-10T15:29:22Z")

</div>

Yea same, I tried searching the forum but I didn’t find anything I was wondering if I was missing something basic. Glad to know it wasn’t me (this time).

---

<div class="post-metadata">

**Author:** ![Matthew\_Automation](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@Matthew\_Automation](https://forum.inductiveautomation.com/u/Matthew_Automation)\
**Post date:** [March 10, 2026, 5:27pm UTC](https://forum.inductiveautomation.com/t/ign-15680-way-to-audit-named-queries/114416/4 "2026-03-10T17:27:01Z")

</div>

You can use system.util.audit() to generate your own audit events. Not ideal, but might help hold you over until they resolve this.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [March 10, 2026, 5:36pm UTC](https://forum.inductiveautomation.com/t/ign-15680-way-to-audit-named-queries/114416/5 "2026-03-10T17:36:41Z")

</div>

Yea that is why I noticed this initiall. In one section I was using `system.util.audit` and running a `runPrepUpdate` and I saw my audits and SQL queries interpersed correctly. Then in this new spot I was like lets try a named query curious what the audit trail would look like and only saw my manual audits, hence this post.
