audit_logs
Creates, updates, deletes, gets or lists an audit_logs resource.
Overview
| Name | audit_logs |
| Type | Resource |
| Id | cloudflare.user.audit_logs |
Fields
The following fields are returned by SELECT queries:
- list
Get user audit logs response
| Name | Datatype | Description |
|---|---|---|
id | string | A string that uniquely identifies the audit log. (example: d5b0f326-1232-4452-8858-1089bd7168ef) |
action | object | |
actor | object | |
interface | string | The source of the event. (example: API) |
metadata | object | An object which can lend more context to the action being logged. This is a flexible value and varies between different actions. |
newValue | string | The new value of the resource that was modified. (example: low) |
oldValue | string | The value of the resource before it was modified. (example: high) |
owner | object | |
resource | object | |
when | string (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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | id, export, action.type, actor.ip, actor.email, since, before, zone.name, direction, per_page, page, hide_user_logs | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
action.type | string | |
actor.email | string (email) | |
actor.ip | string | |
before | string (date) | |
direction | string | |
export | boolean | |
hide_user_logs | boolean | |
id | string | |
page | number | |
per_page | number | |
since | string (date) | |
zone.name | string |
SELECT examples
- list
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 }}'
;