You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.



integer/array auditlog.get(object parameters)

The method allows to retrieve audit log records according to the given parameters.

This method is only available to Super admin user type. Permissions to call the method can be revoked in user role settings. See User roles for more information.


(object) Parameters defining the desired output.

The method supports the following parameters.

Parameter Type Description
auditids ID/array Return only audit log with the given IDs.
userids ID/array Return only audit log that were created by the given users.
time_from timestamp Returns only audit log entries that have been created after or at the given time.
time_till timestamp Returns only audit log entries that have been created before or at the given time.
sortfield string/array Sort the result by the given properties.

Possible values: auditid, userid, clock.
countOutput boolean These parameters being common for all get methods are described in the reference commentary.
excludeSearch boolean
filter object
limit integer
output query
preservekeys boolean
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

Return values

(integer/array) Returns either:

  • an array of objects;
  • the count of retrieved objects, if the countOutput parameter has been used.


Retrieve audit log

Retrieve two latest audit log records.


           "jsonrpc": "2.0",
           "method": "auditlog.get",
           "params": {
               "output": "extend",
               "sortfield": "clock",
               "sortorder": "DESC",
               "limit": 2
           "id": 1


           "jsonrpc": "2.0",
           "result": [
                   "auditid": "cksstgfam0001yhdcc41y20q2",
                   "userid": "1",
                   "username": "Admin",
                   "clock": "1629975715",
                   "ip": "",
                   "action": "1",
                   "resourcetype": "0",
                   "resourceid": "0",
                   "resourcename": "Jim",
                   "recordsetid": "cksstgfal0000yhdcso67ondl",
                   "details": "{\"\":[\"update\",\"Jim\",\"\"],\"user.medias[37]\":[\"add\"],\"user.medias[37].\":[\"add\"],\"user.medias[37].mediatypeid\":[\"add\",\"1\"],\"user.medias[37].sendto\":[\"add\",\"[email protected]\"]}"
                   "auditid": "ckssofl0p0001yhdcqxclsg8r",
                   "userid": "1",
                   "username": "Admin",
                   "clock": "1629967278",
                   "ip": "",
                   "action": "0",
                   "resourcetype": "0",
                   "resourceid": "20",
                   "resourcename": "John",
                   "recordsetid": "ckssofl0p0000yhdcpxyo1jgo",
                   "details": "{\"user.username\":[\"add\",\"John\"], \"user.userid:\":[\"add\",\"20\"],\"user.usrgrps[28]\":[\"add\"],\"user.usrgrps[28].usrgrpid\":[\"add\", \"7\"]}"
           "id": 1

See also


CAuditLog::get() in ui/include/classes/api/services/CAuditLog.php.