Logs

logs

Logs

Control

logs.control

logs.control.cmb

logs.control.cmb.config

Methods

Update Cmb Config -> Envelope<>
post/accounts/{account_id}/logs/control/cmb/config

Updates CMB config.

Delete Cmb Config -> Envelope<unknown>
delete/accounts/{account_id}/logs/control/cmb/config

Deletes CMB config.

Get Cmb Config -> Envelope<>
get/accounts/{account_id}/logs/control/cmb/config

Gets CMB config.

Domain types

CmbConfig = { regions }
LogsControl

Retention

logs.control.retention

Methods

Update Log Retention Flag -> Envelope<{ flag }>
post/zones/{zone_id}/logs/control/retention/flag

Updates log retention flag for Logpull API.

Get Log Retention Flag -> Envelope<{ flag }>
get/zones/{zone_id}/logs/control/retention/flag

Gets log retention flag for Logpull API.

Logs

RayID

logs.rayid

Methods

Get Logs Ray IDs -> string | unknown
get/zones/{zone_id}/logs/rayids/{ray_id}

The /rayids api route allows lookups by specific rayid. The rayids route will return zero, one, or more records (ray ids are not unique).

Security

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example: Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY

Accepted Permissions (at least one required)

Logs Write Logs Read

Parameters
zone_id: string
(maxLength: 32)

Identifier

ray_id: string
(maxLength: 16)

Ray identifier.

fields: string
Optional

The /received route by default returns a limited set of fields, and allows customers to override the default field set by specifying individual fields. The reasons for this are: 1. Most customers require only a small subset of fields, but that subset varies from customer to customer; 2. Flat schema is much easier to work with downstream (importing into BigTable etc); 3. Performance (time to process, file size). If ?fields= is not specified, default field set is returned. This default field set may change at any time. When ?fields= is provided, each record is returned with the specified fields. fields must be specified as a comma separated list without any whitespaces, and all fields must exist. The order in which fields are specified does not matter, and the order of fields in the response is not specified.

timestamps:
Optional

By default, timestamps in responses are returned as Unix nanosecond integers. The ?timestamps= argument can be set to change the format in which response timestamps are returned. Possible values are: unix, unixnano, rfc3339. Note that unix and unixnano return timestamps as integers; rfc3339 returns timestamps as strings.

"unix"
"unixnano"
"rfc3339"
Response fields
UnionMember0 = string
UnionMember1 = unknown
Request example
200Example
Logs

Received

logs.received

Methods

Get Logs Received -> string | unknown
get/zones/{zone_id}/logs/received

The /received api route allows customers to retrieve their edge HTTP logs. The basic access pattern is "give me all the logs for zone Z for minute M", where the minute M refers to the time records were received at Cloudflare's central data center. start is inclusive, and end is exclusive. Because of that, to get all data, at minutely cadence, starting at 10AM, the proper values are: start=2018-05-20T10:00:00Z&end=2018-05-20T10:01:00Z, then start=2018-05-20T10:01:00Z&end=2018-05-20T10:02:00Z and so on; the overlap will be handled properly.

logs.received.fields

Methods

List Fields -> { key }
get/zones/{zone_id}/logs/received/fields

Lists all fields available. The response is json object with key-value pairs, where keys are field names, and values are descriptions.