Skip to main content

audit_logs

Creates, updates, deletes, gets or lists an audit_logs resource.

Overview​

Nameaudit_logs
TypeResource
Idcloudflare.user.audit_logs

Fields​

The following fields are returned by SELECT queries:

Get user audit logs response

NameDatatypeDescription
idstringA string that uniquely identifies the audit log. (example: d5b0f326-1232-4452-8858-1089bd7168ef)
actionobject
actorobject
interfacestringThe source of the event. (example: API)
metadataobjectAn object which can lend more context to the action being logged. This is a flexible value and varies between different actions.
newValuestringThe new value of the resource that was modified. (example: low)
oldValuestringThe value of the resource before it was modified. (example: high)
ownerobject
resourceobject
whenstring (date-time)A UTC RFC3339 timestamp that specifies when the action being logged occured. (example: 2017-04-26T17:31:07Z)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectid, export, action.type, actor.ip, actor.email, since, before, zone.name, direction, per_page, page, hide_user_logsGets a list of audit logs for a user account. Can be filtered by who made the change, on which zone, and the timeframe of the change.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
action.typestring
actor.emailstring (email)
actor.ipstring
beforestring (date)
directionstring
exportboolean
hide_user_logsboolean
idstring
pagenumber
per_pagenumber
sincestring (date)
zone.namestring

SELECT examples​

Gets a list of audit logs for a user account. Can be filtered by who made the change, on which zone, and the timeframe of the change.

SELECT
id,
action,
actor,
interface,
metadata,
newValue,
oldValue,
owner,
resource,
when
FROM cloudflare.user.audit_logs
WHERE id = '{{ id }}'
AND export = '{{ export }}'
AND action.type = '{{ action.type }}'
AND actor.ip = '{{ actor.ip }}'
AND actor.email = '{{ actor.email }}'
AND since = '{{ since }}'
AND before = '{{ before }}'
AND zone.name = '{{ zone.name }}'
AND direction = '{{ direction }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
AND hide_user_logs = '{{ hide_user_logs }}'
;