Auditing
This module provides a set of functions to retrieve data from the Control process's audit tables in a consistent and predictable manner. The .a
audit namespace contains a generic API .a.getAudits
, which can trigger the API for each audit table. The specific audit APIs share the same input structure. They accept three parameters and return the result table of the query defined by the inputs.
.a.getAudits
This is a generic audit API.
Insights:
- The order of the columns in the result table is predefined and fixed for each audit table.
- By default, the results are sorted in ascending order based on the first column. Passing a negative
numRows
value returns the records in descending order. - A timestamp filter is automatically created if not explicitly included in
rowFilters
. The default timestamp filter selects today’s entries. - The operations that can be used for filtering are
`eq`gt`lt`in
. The first three require one value to compare against, like(`eq;`ver;1000)
, whilein
requires two values, for example(`in;`class;`usergroup`entitygroup)
. - The same permission is needed to call the audit APIs as required to view the content of the audit tables in the Control UI.
Parameters:
Name | Type | Description |
---|---|---|
auditTable | symbol | Audit table name |
logComponent | symbol | Log component name for debug logging |
colFilter | list of symbols | Column names to include in the result |
rowFilters | list of lists | The conditions of the query’s where clause as triplets of (`operationName;`columnName;value(s)) |
numRows | int | Maximum number of rows to include in the result table. Use 0Ni to return all records |
Example:
.a.getAudits[`.v.getVersionAudits;`VersionAudit;`;();0Ni]
.a.getVersionAudits
Retrieve data from Control's version audit table .v.audit
.
Parameters:
Name | Type | Description |
---|---|---|
colFilter | list of symbols | Column names to include in the result. The set of columns that can be selected in the order they appear in the result are: `ver`class`entity`action`user`timestamp`ip`checkactive |
rowFilters | list of lists | The conditions of the query’s where clause as triplets of (`operationName;`columnName;value(s)) |
numRows | int | Maximum number of rows to include in the result table. Use 0Ni to return all records |
Example:
colFilter: `ver`class`entity;
rowFilters: ((`eq;`action;`import);(`in;`class;`usergroup`entitygroup));
numRows: 3;
.a.getVersionAudits[colFilter;rowFilters;numRows]
.a.getSessionAudits
Retrieve data from Control's session audit table .session.sessionaudit
.
Parameters:
Name | Type | Description |
---|---|---|
colFilter | list of symbols | Column names to include in the result. The set of columns that can be selected in the order they appear in the result are: `time`user`sessionType`action`success`sessionID`machineID`tomcatID`ip`error`url |
rowFilters | list of lists | The conditions of the query’s where clause as triplets of (`operationName;`columnName;value(s)) |
numRows | int | Maximum number of rows to include in the result table. Use 0Ni to return all records |
Example:
colFilter: `ver`class`entity;
rowFilters: ((`eq;`action;`import);(`in;`class;`usergroup`entitygroup));
numRows: 3;
.a.getSessionAudits[colFilter;rowFilters;numRows]