---
title: Log Explorer
---

[Skip to content](#%5Ftop) 

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

[Logs](https://developers.cloudflare.com/api/go/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/go/resources/logs/subresources/log%5Fexplorer/subresources/query/methods/sql)

client.Logs.LogExplorer.Query.Sql(ctx, params) (\*SinglePage\[[LogExplorerQuerySqlResponse](https://developers.cloudflare.com/api/go/resources/logs#%28resource%29%20logs.log%5Fexplorer.query%20%3E%20%28model%29%20LogExplorerQuerySqlResponse%20%3E%20%28schema%29)\], error)

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

#### Log ExplorerDatasets

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

client.Logs.LogExplorer.Datasets.List(ctx, params) (\*SinglePage\[[DatasetSummary](https://developers.cloudflare.com/api/go/resources/logs#%28resource%29%20logs.log%5Fexplorer.datasets%20%3E%20%28model%29%20dataset%5Fsummary%20%3E%20%28schema%29)\], error)

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

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

client.Logs.LogExplorer.Datasets.Get(ctx, datasetID, query) (\*[Dataset](https://developers.cloudflare.com/api/go/resources/logs#%28resource%29%20logs.log%5Fexplorer.datasets%20%3E%20%28model%29%20dataset%20%3E%20%28schema%29), error)

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

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

client.Logs.LogExplorer.Datasets.New(ctx, params) (\*[Dataset](https://developers.cloudflare.com/api/go/resources/logs#%28resource%29%20logs.log%5Fexplorer.datasets%20%3E%20%28model%29%20dataset%20%3E%20%28schema%29), error)

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

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

client.Logs.LogExplorer.Datasets.Update(ctx, datasetID, params) (\*[Dataset](https://developers.cloudflare.com/api/go/resources/logs#%28resource%29%20logs.log%5Fexplorer.datasets%20%3E%20%28model%29%20dataset%20%3E%20%28schema%29), error)

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

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

client.Logs.LogExplorer.Datasets.Delete(ctx, datasetID, body) (\*[Dataset](https://developers.cloudflare.com/api/go/resources/logs#%28resource%29%20logs.log%5Fexplorer.datasets%20%3E%20%28model%29%20dataset%20%3E%20%28schema%29), error)

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

##### ModelsExpand Collapse 

type CreateRequest struct{…}

Dataset string

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

Fields \[\]CreateRequestFieldOptional

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 string

Field name in lowercase.

Filter stringOptional

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.

type Dataset struct{…}

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

CreatedAt Time

RFC3339 timestamp recording when the API created this dataset.

formatdate-time

Dataset string

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

DatasetID string

Unique dataset ID.

DeletionProtection bool

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

Enabled bool

Whether log ingest is currently active for this dataset.

Fields \[\]DatasetField

The field configuration for this dataset.

Enabled bool

Whether the API includes this field in log ingest.

Name string

Field name in lowercase.

ObjectID string

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

ObjectType DatasetObjectType

Whether this dataset belongs to an account or a zone.

One of the following:

const DatasetObjectTypeAccount DatasetObjectType \= "account"

const DatasetObjectTypeZone DatasetObjectType \= "zone"

UpdatedAt Time

RFC3339 timestamp recording when the API last updated this dataset.

formatdate-time

Filter stringOptional

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

type DatasetSummary struct{…}

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

CreatedAt Time

RFC3339 timestamp recording when the API created this dataset.

formatdate-time

Dataset string

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

DatasetID string

Unique dataset ID.

DeletionProtection bool

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

Enabled bool

Whether log ingest is currently active for this dataset.

ObjectID string

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

ObjectType DatasetSummaryObjectType

Whether this dataset belongs to an account or a zone.

One of the following:

const DatasetSummaryObjectTypeAccount DatasetSummaryObjectType \= "account"

const DatasetSummaryObjectTypeZone DatasetSummaryObjectType \= "zone"

UpdatedAt Time

RFC3339 timestamp recording when the API last updated this dataset.

formatdate-time

type UpdateRequest struct{…}

Enabled bool

Whether to enable or disable log ingest for this dataset.

DeletionProtection boolOptional

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

Fields \[\]UpdateRequestFieldOptional

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 string

Field name in lowercase.

Filter stringOptional

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/go/resources/logs/subresources/log%5Fexplorer/subresources/datasets/subresources/available/methods/list)

client.Logs.LogExplorer.Datasets.Available.List(ctx, query) (\*SinglePage\[[AvailableDataset](https://developers.cloudflare.com/api/go/resources/logs#%28resource%29%20logs.log%5Fexplorer.datasets.available%20%3E%20%28model%29%20available%5Fdataset%20%3E%20%28schema%29)\], error)

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

##### ModelsExpand Collapse 

type AvailableDataset struct{…}

A dataset type that the account or zone can create.

Dataset string

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

ObjectType AvailableDatasetObjectType

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

One of the following:

const AvailableDatasetObjectTypeAccount AvailableDatasetObjectType \= "account"

const AvailableDatasetObjectTypeZone AvailableDatasetObjectType \= "zone"

Schema AvailableDatasetSchema

JSON Schema that describes the fields this dataset exposes.

Properties map\[string, unknown\]Optional

Required \[\]stringOptional

Type AvailableDatasetSchemaTypeOptional

TimestampField string

The primary timestamp field name for this dataset.

type AvailableList struct{…}

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

Code int64

minimum1000

Message string

DocumentationURL stringOptional

Source ResponseInfoSourceOptional

Pointer stringOptional

Messages \[\]string

Success bool

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

Dataset string

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

ObjectType AvailableDatasetObjectType

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

One of the following:

const AvailableDatasetObjectTypeAccount AvailableDatasetObjectType \= "account"

const AvailableDatasetObjectTypeZone AvailableDatasetObjectType \= "zone"

Schema AvailableDatasetSchema

JSON Schema that describes the fields this dataset exposes.

Properties map\[string, unknown\]Optional

Required \[\]stringOptional

Type AvailableDatasetSchemaTypeOptional

TimestampField string

The primary timestamp field name for this dataset.