---
title: Log Explorer
---

[Skip to content](#%5Ftop) 

[API Reference](https://developers.cloudflare.com/api/python)

[Logs](https://developers.cloudflare.com/api/python/resources/logs)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Log Explorer

#### Log ExplorerQuery

##### [Run a log query](https://developers.cloudflare.com/api/python/resources/logs/subresources/log%5Fexplorer/subresources/query/methods/sql)

logs.log\_explorer.query.sql(QuerySqlParams\*\*kwargs)  \-> SyncSinglePage\[[QuerySqlResponse](https://developers.cloudflare.com/api/python/resources/logs#%28resource%29%20logs.log%5Fexplorer.query%20%3E%20%28model%29%20query%5Fsql%5Fresponse%20%3E%20%28schema%29)\]

POST/{accounts\_or\_zones}/{account\_or\_zone\_id}/logs/explorer/query/sql

##### ModelsExpand Collapse 

Dict\[str, object\]

#### Log ExplorerDatasets

##### [List account or zone datasets](https://developers.cloudflare.com/api/python/resources/logs/subresources/log%5Fexplorer/subresources/datasets/methods/list)

logs.log\_explorer.datasets.list(DatasetListParams\*\*kwargs)  \-> SyncSinglePage\[[DatasetSummary](https://developers.cloudflare.com/api/python/resources/logs#%28resource%29%20logs.log%5Fexplorer.datasets%20%3E%20%28model%29%20dataset%5Fsummary%20%3E%20%28schema%29)\]

GET/{accounts\_or\_zones}/{account\_or\_zone\_id}/logs/explorer/datasets

##### [Get an account or zone dataset](https://developers.cloudflare.com/api/python/resources/logs/subresources/log%5Fexplorer/subresources/datasets/methods/get)

logs.log\_explorer.datasets.get(strdataset\_id, DatasetGetParams\*\*kwargs)  \-> [Dataset](https://developers.cloudflare.com/api/python/resources/logs#%28resource%29%20logs.log%5Fexplorer.datasets%20%3E%20%28model%29%20dataset%20%3E%20%28schema%29)

GET/{accounts\_or\_zones}/{account\_or\_zone\_id}/logs/explorer/datasets/{dataset\_id}

##### [Create an account or zone dataset](https://developers.cloudflare.com/api/python/resources/logs/subresources/log%5Fexplorer/subresources/datasets/methods/create)

logs.log\_explorer.datasets.create(DatasetCreateParams\*\*kwargs)  \-> [Dataset](https://developers.cloudflare.com/api/python/resources/logs#%28resource%29%20logs.log%5Fexplorer.datasets%20%3E%20%28model%29%20dataset%20%3E%20%28schema%29)

POST/{accounts\_or\_zones}/{account\_or\_zone\_id}/logs/explorer/datasets

##### [Update an account or zone dataset](https://developers.cloudflare.com/api/python/resources/logs/subresources/log%5Fexplorer/subresources/datasets/methods/update)

logs.log\_explorer.datasets.update(strdataset\_id, DatasetUpdateParams\*\*kwargs)  \-> [Dataset](https://developers.cloudflare.com/api/python/resources/logs#%28resource%29%20logs.log%5Fexplorer.datasets%20%3E%20%28model%29%20dataset%20%3E%20%28schema%29)

PUT/{accounts\_or\_zones}/{account\_or\_zone\_id}/logs/explorer/datasets/{dataset\_id}

##### [Delete an account or zone dataset](https://developers.cloudflare.com/api/python/resources/logs/subresources/log%5Fexplorer/subresources/datasets/methods/delete)

logs.log\_explorer.datasets.delete(strdataset\_id, DatasetDeleteParams\*\*kwargs)  \-> [Dataset](https://developers.cloudflare.com/api/python/resources/logs#%28resource%29%20logs.log%5Fexplorer.datasets%20%3E%20%28model%29%20dataset%20%3E%20%28schema%29)

DELETE/{accounts\_or\_zones}/{account\_or\_zone\_id}/logs/explorer/datasets/{dataset\_id}

##### ModelsExpand Collapse 

class CreateRequest: …

dataset: str

Dataset type name to create (e.g. `http_requests`).

fields: Optional\[List\[Field\]\]

Controls which fields the API ingests. Defaults to all available fields when absent.

enabled: bool

Whether the API includes this field in log ingest.

name: str

Field name in lowercase.

filter: Optional\[str\]

Optional Logpush filter predicate to restrict which events are ingested. If provided, replaces the dataset’s default filter entirely. See [Logpush filters](https://developers.cloudflare.com/logs/reference/filters/)for syntax and examples.

class Dataset: …

A Log Explorer dataset summary. List endpoints return this type and omit field configuration; use the single-dataset endpoint to retrieve it.

created\_at: datetime

RFC3339 timestamp recording when the API created this dataset.

formatdate-time

dataset: str

Dataset type name (e.g. `http_requests`).

dataset\_id: str

Unique dataset ID.

deletion\_protection: bool

Whether deletion is blocked. Set to `false` before deleting the dataset.

enabled: bool

Whether log ingest is currently active for this dataset.

fields: List\[Field\]

The field configuration for this dataset.

enabled: bool

Whether the API includes this field in log ingest.

name: str

Field name in lowercase.

object\_id: str

Public ID of the account or zone that owns this dataset.

object\_type: Literal\["account", "zone"\]

Whether this dataset belongs to an account or a zone.

One of the following:

"account"

"zone"

updated\_at: datetime

RFC3339 timestamp recording when the API last updated this dataset.

formatdate-time

filter: Optional\[str\]

The Logpush filter predicate applied to this dataset. Omitted when no filter is set.

class DatasetSummary: …

A Log Explorer dataset summary. List endpoints return this type and omit field configuration; use the single-dataset endpoint to retrieve it.

created\_at: datetime

RFC3339 timestamp recording when the API created this dataset.

formatdate-time

dataset: str

Dataset type name (e.g. `http_requests`).

dataset\_id: str

Unique dataset ID.

deletion\_protection: bool

Whether deletion is blocked. Set to `false` before deleting the dataset.

enabled: bool

Whether log ingest is currently active for this dataset.

object\_id: str

Public ID of the account or zone that owns this dataset.

object\_type: Literal\["account", "zone"\]

Whether this dataset belongs to an account or a zone.

One of the following:

"account"

"zone"

updated\_at: datetime

RFC3339 timestamp recording when the API last updated this dataset.

formatdate-time

class UpdateRequest: …

enabled: bool

Whether to enable or disable log ingest for this dataset.

deletion\_protection: Optional\[bool\]

Set to `false` to allow deletion of this dataset.

fields: Optional\[List\[Field\]\]

Controls which fields the API ingests after the update. Defaults to all available fields when absent.

enabled: bool

Whether the API includes this field in log ingest.

name: str

Field name in lowercase.

filter: Optional\[str\]

Optional Logpush filter predicate to restrict which events are ingested. If omitted, the existing filter is left unchanged. Set to an empty string (`""`) to clear the filter. Otherwise, replaces the dataset’s filter entirely. See [Logpush filters](https://developers.cloudflare.com/logs/reference/filters/)for syntax and examples.

#### Log ExplorerDatasetsAvailable

##### [List available account or zone datasets](https://developers.cloudflare.com/api/python/resources/logs/subresources/log%5Fexplorer/subresources/datasets/subresources/available/methods/list)

logs.log\_explorer.datasets.available.list(AvailableListParams\*\*kwargs)  \-> SyncSinglePage\[[AvailableDataset](https://developers.cloudflare.com/api/python/resources/logs#%28resource%29%20logs.log%5Fexplorer.datasets.available%20%3E%20%28model%29%20available%5Fdataset%20%3E%20%28schema%29)\]

GET/{accounts\_or\_zones}/{account\_or\_zone\_id}/logs/explorer/datasets/available

##### ModelsExpand Collapse 

class AvailableDataset: …

A dataset type that the account or zone can create.

dataset: str

Dataset type name (e.g. `http_requests`).

object\_type: Literal\["account", "zone"\]

Whether this dataset type is account-scoped or zone-scoped.

One of the following:

"account"

"zone"

schema: Schema

JSON Schema that describes the fields this dataset exposes.

properties: Optional\[Dict\[str, object\]\]

required: Optional\[List\[str\]\]

type: Optional\[Literal\["object"\]\]

timestamp\_field: str

The primary timestamp field name for this dataset.

class AvailableList: …

errors: List\[[ResponseInfo](https://developers.cloudflare.com/api/python/resources/$shared#%28resource%29%20%24shared%20%3E%20%28model%29%20response%5Finfo%20%3E%20%28schema%29)\]

code: int

minimum1000

message: str

documentation\_url: Optional\[str\]

source: Optional\[Source\]

pointer: Optional\[str\]

messages: List\[str\]

success: bool

result: Optional\[List\[[AvailableDataset](https://developers.cloudflare.com/api/python/resources/logs#%28resource%29%20logs.log%5Fexplorer.datasets.available%20%3E%20%28model%29%20available%5Fdataset%20%3E%20%28schema%29)\]\]

dataset: str

Dataset type name (e.g. `http_requests`).

object\_type: Literal\["account", "zone"\]

Whether this dataset type is account-scoped or zone-scoped.

One of the following:

"account"

"zone"

schema: Schema

JSON Schema that describes the fields this dataset exposes.

properties: Optional\[Dict\[str, object\]\]

required: Optional\[List\[str\]\]

type: Optional\[Literal\["object"\]\]

timestamp\_field: str

The primary timestamp field name for this dataset.