Skip to content
Start here

Logs

LogsLog Explorer

LogsLog ExplorerQuery

Run a log query
logs.log_explorer.query.sql(QuerySqlParams**kwargs) -> SyncSinglePage[QuerySqlResponse]
POST/{accounts_or_zones}/{account_or_zone_id}/logs/explorer/query/sql
ModelsExpand Collapse
Dict[str, object]

LogsLog ExplorerDatasets

List account or zone datasets
logs.log_explorer.datasets.list(DatasetListParams**kwargs) -> SyncSinglePage[DatasetSummary]
GET/{accounts_or_zones}/{account_or_zone_id}/logs/explorer/datasets
Get an account or zone dataset
logs.log_explorer.datasets.get(strdataset_id, DatasetGetParams**kwargs) -> Dataset
GET/{accounts_or_zones}/{account_or_zone_id}/logs/explorer/datasets/{dataset_id}
Create an account or zone dataset
logs.log_explorer.datasets.create(DatasetCreateParams**kwargs) -> Dataset
POST/{accounts_or_zones}/{account_or_zone_id}/logs/explorer/datasets
Update an account or zone dataset
logs.log_explorer.datasets.update(strdataset_id, DatasetUpdateParams**kwargs) -> Dataset
PUT/{accounts_or_zones}/{account_or_zone_id}/logs/explorer/datasets/{dataset_id}
Delete an account or zone dataset
logs.log_explorer.datasets.delete(strdataset_id, DatasetDeleteParams**kwargs) -> Dataset
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 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 for syntax and examples.

LogsLog ExplorerDatasetsAvailable

List available account or zone datasets
logs.log_explorer.datasets.available.list(AvailableListParams**kwargs) -> SyncSinglePage[AvailableDataset]
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]
code: int
minimum1000
message: str
documentation_url: Optional[str]
source: Optional[Source]
pointer: Optional[str]
messages: List[str]
success: bool
result: Optional[List[AvailableDataset]]
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.

LogsControl

LogsControlRetention

Get log retention flag
logs.control.retention.get(RetentionGetParams**kwargs) -> RetentionGetResponse
GET/zones/{zone_id}/logs/control/retention/flag
Update log retention flag
logs.control.retention.create(RetentionCreateParams**kwargs) -> RetentionCreateResponse
POST/zones/{zone_id}/logs/control/retention/flag
ModelsExpand Collapse
class RetentionGetResponse:
flag: Optional[bool]

The log retention flag for Logpull API.

class RetentionCreateResponse:
flag: Optional[bool]

The log retention flag for Logpull API.

LogsControlCmb

LogsControlCmbConfig

Get CMB config
logs.control.cmb.config.get(ConfigGetParams**kwargs) -> CmbConfig
GET/accounts/{account_id}/logs/control/cmb/config
Update CMB config
logs.control.cmb.config.create(ConfigCreateParams**kwargs) -> CmbConfig
POST/accounts/{account_id}/logs/control/cmb/config
Delete CMB config
logs.control.cmb.config.delete(ConfigDeleteParams**kwargs) -> object
DELETE/accounts/{account_id}/logs/control/cmb/config
ModelsExpand Collapse
class CmbConfig:
allow_out_of_region_access: Optional[bool]

Allow out of region access

regions: Optional[str]

Name of the region.

maxLength256

LogsRayID

Get logs RayIDs
logs.rayid.get(strrayid, RayIDGetParams**kwargs) -> RayIDGetResponse
GET/zones/{zone_id}/logs/rayids/{ray_id}
ModelsExpand Collapse
Union[str, object]
One of the following:
str
object

LogsReceived

Get logs received
logs.received.get(ReceivedGetParams**kwargs) -> ReceivedGetResponse
GET/zones/{zone_id}/logs/received
ModelsExpand Collapse
Union[str, object]
One of the following:
str
object

LogsReceivedFields

List fields
logs.received.fields.get(FieldGetParams**kwargs) -> FieldGetResponse
GET/zones/{zone_id}/logs/received/fields
ModelsExpand Collapse
class FieldGetResponse:
key: Optional[str]