# queryAuditLog (contextFilter) 8.1.37

**URL:** <https://forum.inductiveautomation.com/t/queryauditlog-contextfilter-8-1-37/86724>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [March 2, 2024, 6:51pm UTC](https://forum.inductiveautomation.com/t/queryauditlog-contextfilter-8-1-37/86724 "2024-03-02T18:51:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwirth](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@bwirth](https://forum.inductiveautomation.com/u/bwirth)\
**Post date:** [March 2, 2024, 6:51pm UTC](https://forum.inductiveautomation.com/t/queryauditlog-contextfilter-8-1-37/86724/1 "2024-03-02T18:51:25Z")

</div>

Upgraded to 8.1.37 and my calls to system.util.queryAuditLog looks to have changed. I use the contextFilter = 0x01 and they do not appear to be filter the context. I get the same values with or without.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 2, 2024, 8:38pm UTC](https://forum.inductiveautomation.com/t/queryauditlog-contextfilter-8-1-37/86724/2 "2024-03-02T20:38:23Z")

</div>

What version did you upgrade from? What kind of audit profile are you querying?

---

<div class="post-metadata">

**Author:** ![bwirth](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@bwirth](https://forum.inductiveautomation.com/u/bwirth)\
**Post date:** [March 3, 2024, 4:41pm UTC](https://forum.inductiveautomation.com/t/queryauditlog-contextfilter-8-1-37/86724/3 "2024-03-03T16:41:37Z")

</div>

I went from 8.1.33 to 8.1.37. I think you may have fixed another "feature" that I was taking advantage of. When I wrote to a MQTT Engine tag, I would get an audit record from the user and another from the gateway. I think it previously contexted the gateway writes differently (null if I remember correctly). This way when I used the context filter = 0x01 it would only show the user write. I think I need to include a systemFilter = '%/project" if I want it to work similar as it was.

```auto

startDt = system.date.addDays(system.date.now(),-3)
endDt = system.date.now()
actor = ''
srcPath = '%Edge Nodes/HORIZONTAL/Highland Super Battery/Block A/Wells/Pad 1/Well 1/Gas Lift/Injection Flow Rate Setpoint%'
#srcPath = system.tag.readBlocking([srcPath + ".path"])[0].value

print startDt, endDt, srcPath

ad = system.util.queryAuditLog(auditProfileName = 'Audit', startDate = startDt, endDate = endDt, targetFilter=srcPath, actorFilter=actor, contextFilter=0x01) # 20230620 added contextFilter (only shows user gateway writes)
ad = system.dataset.sort(ad,"Timestamp",False)

print ad
cols = ad.getColumnNames()
print cols
for a in range(ad.getRowCount()) :
	print [ad.getValueAt(a, col) for col in cols]

```

== output ==

````auto
Thu Feb 29 10:29:39 CST 2024 Sun Mar 03 10:29:39 CST 2024 %Edge Nodes/HORIZONTAL/Highland Super Battery/Block A/Wells/Pad 1/Well 1/Gas Lift/Injection Flow Rate Setpoint%
Dataset [6R ⅹ 11C]
[Timestamp, Actor, Actor Host, Action, Action Target, Action Value, Result Code, Result, System, Context Code, Context]
[Sun Mar 03 07:09:45 CST 2024, u'aXXXXXX', u'scadaXXXXXXXX', u'tag write', u'[MQTT Engine]Edge Nodes/HORIZONTAL/Highland Super Battery/Block A/Wells/Pad 1/Well 1/Gas Lift/Injection Flow Rate Setpoint', u'[0, Good, Sun Mar 03 07:09:45 CST 2024 (1709471385289)]', 0, u'AuditStatus[0x00000000, Severity=Good, Subcode=NotSpecified]', u'Ignition-SCADAXXXXXXXX', 1, u'Gateway']
[Sun Mar 03 07:09:45 CST 2024, u'aXXXXXX', u'XXX.XX.XXX.XXX', u'tag write', u'[MQTT Engine]Edge Nodes/HORIZONTAL/Highland Super Battery/Block A/Wells/Pad 1/Well 1/Gas Lift/Injection Flow Rate Setpoint', u'0', 0, u'AuditStatus[0x00000000, Severity=Good, Subcode=NotSpecified]', u'sys:Ignition-SCADAXXXXXXXX:/project:DiscoverySCADA:/project:DiscoverySCADA', 1, u'Gateway']
[Fri Mar 01 14:40:27 CST 2024, u'aXXXXXX', u'scadaXXXXXXXX', u'tag write', u'[MQTT Engine]Edge Nodes/HORIZONTAL/Highland Super Battery/Block A/Wells/Pad 1/Well 1/Gas Lift/Injection Flow Rate Setpoint', u'[800, Good, Fri Mar 01 14:40:27 CST 2024 (1709325627504)]', 0, u'AuditStatus[0x00000000, Severity=Good, Subcode=NotSpecified]', u'Ignition-SCADAXXXXXXXX', 1, u'Gateway']
[Fri Mar 01 14:40:27 CST 2024, u'aXXXXXX', u'XXX.XX.XXX.XXX', u'tag write', u'[MQTT Engine]Edge Nodes/HORIZONTAL/Highland Super Battery/Block A/Wells/Pad 1/Well 1/Gas Lift/Injection Flow Rate Setpoint', u'800', 0, u'AuditStatus[0x00000000, Severity=Good, Subcode=NotSpecified]', u'sys:Ignition-SCADAXXXXXXXX:/project:DiscoverySCADA:/project:DiscoverySCADA', 1, u'Gateway']
[Fri Mar 01 14:02:49 CST 2024, u'aXXXXXX', u'scadaXXXXXXXX', u'tag write', u'[MQTT Engine]Edge Nodes/HORIZONTAL/Highland Super Battery/Block A/Wells/Pad 1/Well 1/Gas Lift/Injection Flow Rate Setpoint', u'[850, Good, Fri Mar 01 14:02:49 CST 2024 (1709323369911)]', 0, u'AuditStatus[0x00000000, Severity=Good, Subcode=NotSpecified]', u'Ignition-SCADAXXXXXXXX', 1, u'Gateway']
[Fri Mar 01 14:02:49 CST 2024, u'aXXXXXX', u'XXX.XX.XXX.XXX', u'tag write', u'[MQTT Engine]Edge Nodes/HORIZONTAL/Highland Super Battery/Block A/Wells/Pad 1/Well 1/Gas Lift/Injection Flow Rate Setpoint', u'850', 0, u'AuditStatus[0x00000000, Severity=Good, Subcode=NotSpecified]', u'sys:Ignition-SCADAXXXXXXXX:/project:DiscoverySCADA:/project:DiscoverySCADA', 1, u'Gateway']
>>> ```
````
