zones_logs_explorer_datasets
Creates, updates, deletes, gets or lists a zones_logs_explorer_datasets resource.
Overview
| Name | zones_logs_explorer_datasets |
| Type | Resource |
| Id | cloudflare.logs.zones_logs_explorer_datasets |
Fields
The following fields are returned by SELECT queries:
- get
- list
Dataset details, including the fields active for ingestion.
| Name | Datatype | Description |
|---|---|---|
dataset_id | string | Unique dataset ID. |
object_id | string | Public ID of the account or zone that owns this dataset. |
created_at | string (date-time) | RFC3339 timestamp recording when the API created this dataset. |
dataset | string | Dataset type name (e.g. http_requests). |
enabled | boolean | Whether log ingest is currently active for this dataset. |
fields | array | The field configuration for this dataset. |
object_type | string | Whether this dataset belongs to an account or a zone. (account, zone) |
updated_at | string (date-time) | RFC3339 timestamp recording when the API last updated this dataset. |
The datasets the account or zone has configured.
| Name | Datatype | Description |
|---|---|---|
dataset_id | string | Unique dataset ID. |
object_id | string | Public ID of the account or zone that owns this dataset. |
created_at | string (date-time) | RFC3339 timestamp recording when the API created this dataset. |
dataset | string | Dataset type name (e.g. http_requests). |
enabled | boolean | Whether log ingest is currently active for this dataset. |
object_type | string | Whether this dataset belongs to an account or a zone. (account, zone) |
updated_at | string (date-time) | RFC3339 timestamp recording when the API last updated this dataset. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, dataset_id | Retrieve a single Log Explorer dataset by ID for the account or zone. | |
list | select | account_id | include_zones | Returns all Log Explorer datasets configured for the account or zone. Pass include_zones=true to also include zone-level datasets that belong to this account or zone. List responses omit the fields property; use the single-dataset endpoint to retrieve field configuration. |
post_zones_zone_id_logs_explorer_datasets | insert | account_id, dataset | Create a new Log Explorer dataset for the account or zone. Use the /account or zones/{account or zone_id}/logs/explorer/datasets/available endpoint to list dataset types you can create along with their available fields. The fields property is optional. If not specified, all available fields will be enabled. | |
put_zones_zone_id_logs_explorer_datasets_dataset_id | replace | account_id, dataset_id, enabled | Updates the enabled state and/or field configuration of an account or zone dataset. |
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 |
|---|---|---|
account_id | string | The Cloudflare account ID. |
dataset_id | string | The dataset ID. |
include_zones | boolean | Set to true to include zone-scoped datasets belonging to this account. |
SELECT examples
- get
- list
Retrieve a single Log Explorer dataset by ID for the account or zone.
SELECT
dataset_id,
object_id,
created_at,
dataset,
enabled,
fields,
object_type,
updated_at
FROM cloudflare.logs.zones_logs_explorer_datasets
WHERE account_id = '{{ account_id }}' -- required
AND dataset_id = '{{ dataset_id }}' -- required
;
Returns all Log Explorer datasets configured for the account or zone. Pass include_zones=true to also include zone-level datasets that belong to this account or zone. List responses omit the fields property; use the single-dataset endpoint to retrieve field configuration.
SELECT
dataset_id,
object_id,
created_at,
dataset,
enabled,
object_type,
updated_at
FROM cloudflare.logs.zones_logs_explorer_datasets
WHERE account_id = '{{ account_id }}' -- required
AND include_zones = '{{ include_zones }}'
;
INSERT examples
- post_zones_zone_id_logs_explorer_datasets
- Manifest
Create a new Log Explorer dataset for the account or zone. Use the /account or zones/{account or zone_id}/logs/explorer/datasets/available endpoint to list dataset types you can create along with their available fields. The fields property is optional. If not specified, all available fields will be enabled.
INSERT INTO cloudflare.logs.zones_logs_explorer_datasets (
dataset,
fields,
account_id
)
SELECT
'{{ dataset }}' /* required */,
'{{ fields }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: zones_logs_explorer_datasets
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the zones_logs_explorer_datasets resource.
- name: dataset
value: "{{ dataset }}"
description: |
Dataset type name to create (e.g. `http_requests`).
- name: fields
description: |
Controls which fields the API ingests. Defaults to all available fields when absent.
value:
- enabled: {{ enabled }}
name: "{{ name }}"
REPLACE examples
- put_zones_zone_id_logs_explorer_datasets_dataset_id
Updates the enabled state and/or field configuration of an account or zone dataset.
REPLACE cloudflare.logs.zones_logs_explorer_datasets
SET
enabled = {{ enabled }},
fields = '{{ fields }}'
WHERE
account_id = '{{ account_id }}' --required
AND dataset_id = '{{ dataset_id }}' --required
AND enabled = {{ enabled }} --required
RETURNING
errors,
messages,
result,
success;