Skip to main content
Version: 7.9

system.util.queryAuditLog

This function is used in Python Scripting.

Description

Queries an audit profile for audit history. Returns the results as a dataset.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax

system.util.queryAuditLog(auditProfileName, startDate, endDate, actorFilter, actionFilter, targetFilter, valueFilter, systemFilter, contextFilter)

Parameters

TypeParameterDescription
StringauditProfileNameThe name of the audit profile to pull the history from.
DatestartDateThe earliest audit event to return. If omitted, the current time - 8 hours will be used.
DateendDateThe latest audit event to return. If omitted, the current time will be used.
StringactorFilterA filter string used to restrict the results by actor.
StringactionFilterA filter string used to restrict the results by action.
StringtargetFilterA filter string used to restrict the results by target.
StringvalueFilterA filter string used to restrict the results by value.
StringsystemFilterA filter string used to restrict the results by system.
IntegercontextFilterA bitmask used to restrict the results by context. 0x01 = Gateway, 0x02 = Designer, 0x04 = Client.

Returns

Dataset - A dataset with the audit events from the specified profile that match the filter arguments.

Scope

Client

Code Examples

Example #1
# This script queries an audit log, checks to see if a user john made any tag writes in the last 8 hours
# (since the startDate parameter is omitted), and writes the results to a table.
data = system.util.queryAuditLog(auditProfileName='AuditLog', actorFilter='john', actionFilter='tag write')

event.source.parent.getComponent("Table").data = data