Skip to main content

audit

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

Overview

Nameaudit
TypeResource
Idcloudflare.accounts.audit

Fields

The following fields are returned by SELECT queries:

Get account audit logs successful response

NameDatatypeDescription
idstringA unique identifier for the audit log entry. (example: 023e105f4ecef8ad9ca31a8372d0c353)
accountobjectContains account related information.
actionobjectProvides information about the action performed.
actorobjectProvides details about the actor who performed the action.
rawobjectProvides raw information about the request and response.
resourceobjectProvides details about the affected resource.
zoneobjectProvides details about the zone affected by the action.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_idaccount_name, action_result, action_type, actor_context, actor_email, actor_id, actor_ip_address, actor_token_id, actor_token_name, actor_type, audit_log_id, id, raw_cf_ray_id, raw_method, raw_status_code, raw_uri, resource_id, resource_product, resource_type, resource_scope, zone_id, zone_name, account_name.not, action_result.not, action_type.not, actor_context.not, actor_email.not, actor_id.not, actor_ip_address.not, actor_token_id.not, actor_token_name.not, actor_type.not, audit_log_id.not, id.not, raw_cf_ray_id.not, raw_method.not, raw_status_code.not, raw_uri.not, resource_id.not, resource_product.not, resource_type.not, resource_scope.not, zone_id.not, zone_name.not, since, before, direction, limit, cursorGets a list of audit logs for an account.

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
account_idstringThe Cloudflare account ID.
account_namearray
account_name.notarray
action_resultarray
action_result.notarray
action_typearray
action_type.notarray
actor_contextarray
actor_context.notarray
actor_emailarray
actor_email.notarray
actor_idarray
actor_id.notarray
actor_ip_addressarray
actor_ip_address.notarray
actor_token_idarray
actor_token_id.notarray
actor_token_namearray
actor_token_name.notarray
actor_typearray
actor_type.notarray
audit_log_idarray
audit_log_id.notarray
beforestring (date)Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.
cursorstring
directionstring
idarray
id.notarray
limitnumber
raw_cf_ray_idarray
raw_cf_ray_id.notarray
raw_methodarray
raw_method.notarray
raw_status_codearray
raw_status_code.notarray
raw_uriarray
raw_uri.notarray
resource_idarray
resource_id.notarray
resource_productarray
resource_product.notarray
resource_scopearray
resource_scope.notarray
resource_typearray
resource_type.notarray
sincestring (date)Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.
zone_idarray
zone_id.notarray
zone_namearray
zone_name.notarray

SELECT examples

Gets a list of audit logs for an account.

SELECT
id,
account,
action,
actor,
raw,
resource,
zone
FROM cloudflare.accounts.audit
WHERE account_id = '{{ account_id }}' -- required
AND account_name = '{{ account_name }}'
AND action_result = '{{ action_result }}'
AND action_type = '{{ action_type }}'
AND actor_context = '{{ actor_context }}'
AND actor_email = '{{ actor_email }}'
AND actor_id = '{{ actor_id }}'
AND actor_ip_address = '{{ actor_ip_address }}'
AND actor_token_id = '{{ actor_token_id }}'
AND actor_token_name = '{{ actor_token_name }}'
AND actor_type = '{{ actor_type }}'
AND audit_log_id = '{{ audit_log_id }}'
AND id = '{{ id }}'
AND raw_cf_ray_id = '{{ raw_cf_ray_id }}'
AND raw_method = '{{ raw_method }}'
AND raw_status_code = '{{ raw_status_code }}'
AND raw_uri = '{{ raw_uri }}'
AND resource_id = '{{ resource_id }}'
AND resource_product = '{{ resource_product }}'
AND resource_type = '{{ resource_type }}'
AND resource_scope = '{{ resource_scope }}'
AND zone_id = '{{ zone_id }}'
AND zone_name = '{{ zone_name }}'
AND account_name.not = '{{ account_name.not }}'
AND action_result.not = '{{ action_result.not }}'
AND action_type.not = '{{ action_type.not }}'
AND actor_context.not = '{{ actor_context.not }}'
AND actor_email.not = '{{ actor_email.not }}'
AND actor_id.not = '{{ actor_id.not }}'
AND actor_ip_address.not = '{{ actor_ip_address.not }}'
AND actor_token_id.not = '{{ actor_token_id.not }}'
AND actor_token_name.not = '{{ actor_token_name.not }}'
AND actor_type.not = '{{ actor_type.not }}'
AND audit_log_id.not = '{{ audit_log_id.not }}'
AND id.not = '{{ id.not }}'
AND raw_cf_ray_id.not = '{{ raw_cf_ray_id.not }}'
AND raw_method.not = '{{ raw_method.not }}'
AND raw_status_code.not = '{{ raw_status_code.not }}'
AND raw_uri.not = '{{ raw_uri.not }}'
AND resource_id.not = '{{ resource_id.not }}'
AND resource_product.not = '{{ resource_product.not }}'
AND resource_type.not = '{{ resource_type.not }}'
AND resource_scope.not = '{{ resource_scope.not }}'
AND zone_id.not = '{{ zone_id.not }}'
AND zone_name.not = '{{ zone_name.not }}'
AND since = '{{ since }}'
AND before = '{{ before }}'
AND direction = '{{ direction }}'
AND limit = '{{ limit }}'
AND cursor = '{{ cursor }}'
;