Skip to content
Start here

Logpush

LogpushDatasets

LogpushDatasetsFields

List fields
client.logpush.datasets.fields.get("access_requests" | "audit_logs" | "audit_logs_v2" | 27 moredatasetId, FieldGetParams { account_id, zone_id } params?, RequestOptionsoptions?): FieldGetResponse
GET/{accounts_or_zones}/{account_or_zone_id}/logpush/datasets/{dataset_id}/fields
ModelsExpand Collapse
FieldGetResponse = unknown

LogpushDatasetsJobs

List Logpush jobs for a dataset
client.logpush.datasets.jobs.get("access_requests" | "audit_logs" | "audit_logs_v2" | 27 moredatasetId, JobGetParams { account_id, zone_id } params?, RequestOptionsoptions?): SinglePage<LogpushJob { id, dataset, destination_conf, 12 more } | null>
GET/{accounts_or_zones}/{account_or_zone_id}/logpush/datasets/{dataset_id}/jobs

LogpushEdge

List Instant Logs jobs
client.logpush.edge.get(EdgeGetParams { zone_id } params, RequestOptionsoptions?): SinglePage<InstantLogpushJob { destination_conf, fields, filter, 2 more } | null>
GET/zones/{zone_id}/logpush/edge/jobs
Create Instant Logs job
client.logpush.edge.create(EdgeCreateParams { zone_id, fields, filter, sample } params, RequestOptionsoptions?): InstantLogpushJob { destination_conf, fields, filter, 2 more } | null
POST/zones/{zone_id}/logpush/edge/jobs
ModelsExpand Collapse
InstantLogpushJob { destination_conf, fields, filter, 2 more }
destination_conf?: string

Unique WebSocket address that will receive messages from Cloudflare’s edge.

formaturi
maxLength4096
fields?: string

Comma-separated list of fields.

filter?: string

Filters to drill down into specific events.

sample?: number

The sample parameter is the sample rate of the records set by the client: "sample": 1 is 100% of records "sample": 10 is 10% and so on.

session_id?: string

Unique session id of the job.

LogpushJobs

List Logpush jobs
client.logpush.jobs.list(JobListParams { account_id, zone_id } params?, RequestOptionsoptions?): SinglePage<LogpushJob { id, dataset, destination_conf, 12 more } | null>
GET/{accounts_or_zones}/{account_or_zone_id}/logpush/jobs
Get Logpush job details
client.logpush.jobs.get(numberjobId, JobGetParams { account_id, zone_id } params?, RequestOptionsoptions?): LogpushJob { id, dataset, destination_conf, 12 more } | null
GET/{accounts_or_zones}/{account_or_zone_id}/logpush/jobs/{job_id}
Create Logpush job
client.logpush.jobs.create(JobCreateParams { destination_conf, account_id, zone_id, 12 more } params, RequestOptionsoptions?): LogpushJob { id, dataset, destination_conf, 12 more } | null
POST/{accounts_or_zones}/{account_or_zone_id}/logpush/jobs
Update Logpush job
client.logpush.jobs.update(numberjobId, JobUpdateParams { account_id, zone_id, destination_conf, 11 more } params, RequestOptionsoptions?): LogpushJob { id, dataset, destination_conf, 12 more } | null
PUT/{accounts_or_zones}/{account_or_zone_id}/logpush/jobs/{job_id}
Delete Logpush job
client.logpush.jobs.delete(numberjobId, JobDeleteParams { account_id, zone_id } params?, RequestOptionsoptions?): JobDeleteResponse { id }
DELETE/{accounts_or_zones}/{account_or_zone_id}/logpush/jobs/{job_id}
ModelsExpand Collapse
LogpushJob { id, dataset, destination_conf, 12 more }
id?: number

Unique id of the job.

minimum1
dataset?: "access_requests" | "audit_logs" | "audit_logs_v2" | 27 more | null

Name of the dataset. A list of supported datasets can be found on the Developer Docs.

One of the following:
"access_requests"
"audit_logs"
"audit_logs_v2"
"biso_user_actions"
"casb_findings"
"device_posture_results"
"dex_application_tests"
"dex_device_state_events"
"dlp_forensic_copies"
"dns_firewall_logs"
"dns_logs"
"email_security_alerts"
"firewall_events"
"gateway_dns"
"gateway_http"
"gateway_network"
"http_requests"
"ipsec_logs"
"magic_ids_detections"
"nel_reports"
"network_analytics_logs"
"page_shield_events"
"sinkhole_http_logs"
"spectrum_events"
"ssh_logs"
"warp_config_changes"
"warp_toggle_changes"
"workers_trace_events"
"zaraz_events"
"zero_trust_network_sessions"
destination_conf?: string

Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.

formaturi
maxLength4096
enabled?: boolean

Flag that indicates if the job is enabled.

error_message?: string | null

If not null, the job is currently failing. Failures are usually. repetitive (example: no permissions to write to destination bucket). Only the last failure is recorded. On successful execution of a job the error_message and last_error are set to null.

Deprecatedfrequency?: "high" | "low" | null

This field is deprecated. Please use max_upload_* parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.

One of the following:
"high"
"low"
kind?: "" | "edge"

The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).

One of the following:
""
"edge"
last_complete?: string | null

Records the last time for which logs have been successfully pushed. If the last successful push was for logs range 2018-07-23T10:00:00Z to 2018-07-23T10:01:00Z then the value of this field will be 2018-07-23T10:01:00Z. If the job has never run or has just been enabled and hasn't run yet then the field will be empty.

formatdate-time
last_error?: string | null

Records the last time the job failed. If not null, the job is currently. failing. If null, the job has either never failed or has run successfully at least once since last failure. See also the error_message field.

formatdate-time
Deprecatedlogpull_options?: string | null

This field is deprecated. Use output_options instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately.

formaturi-reference
maxLength4096
max_upload_bytes?: 0 | number | null

The maximum uncompressed file size of a batch of logs. This setting value must be between 5 MB and 1 GB, or 0 to disable it. Note that you cannot set a minimum file size; this means that log files may be much smaller than this batch size.

One of the following:
0
number
max_upload_interval_seconds?: 0 | number | null

The maximum interval in seconds for log batches. This setting must be between 30 and 300 seconds (5 minutes), or 0 to disable it. Note that you cannot specify a minimum interval for log batches; this means that log files may be sent in shorter intervals than this.

One of the following:
0
number
max_upload_records?: 0 | number | null

The maximum number of log lines per batch. This setting must be between 1000 and 1,000,000 lines, or 0 to disable it. Note that you cannot specify a minimum number of log lines per batch; this means that log files may contain many fewer lines than this.

One of the following:
0
number
name?: string | null

Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.

maxLength512
output_options?: OutputOptions { batch_prefix, batch_suffix, CVE-2021-44228, 10 more } | null

The structured replacement for logpull_options. When including this field, the logpull_option field will be ignored.

OutputOptions { batch_prefix, batch_suffix, CVE-2021-44228, 10 more }

The structured replacement for logpull_options. When including this field, the logpull_option field will be ignored.

batch_prefix?: string | null

String to be prepended before each batch.

batch_suffix?: string | null

String to be appended after each batch.

"CVE-2021-44228"?: boolean | null

If set to true, will cause all occurrences of ${ in the generated files to be replaced with x{.

field_delimiter?: string | null

String to join fields. This field be ignored when record_template is set.

field_names?: Array<string>

List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.

merge_subrequests?: boolean | null

If set to true, subrequests will be merged into the parent request. Only supported for the http_requests dataset.

output_type?: "ndjson" | "csv"

Specifies the output type, such as ndjson or csv. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.

One of the following:
"ndjson"
"csv"
record_delimiter?: string | null

String to be inserted in-between the records as separator.

record_prefix?: string | null

String to be prepended before each record.

record_suffix?: string | null

String to be appended after each record.

record_template?: string | null

String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in field_names as well, otherwise they will end up as null. Format as a Go text/template without any standard functions, like conditionals, loops, sub-templates, etc.

sample_rate?: number | null

Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current sample_interval of the data.

formatfloat
maximum1
minimum0
timestamp_format?: "unixnano" | "unix" | "rfc3339" | 2 more

String to specify the format for timestamps, such as unixnano, unix, rfc3339, rfc3339ms or rfc3339ns.

One of the following:
"unixnano"
"unix"
"rfc3339"
"rfc3339ms"
"rfc3339ns"
JobDeleteResponse { id }
id?: number

Unique id of the job.

minimum1

LogpushOwnership

Get ownership challenge
client.logpush.ownership.create(OwnershipCreateParams { destination_conf, account_id, zone_id } params, RequestOptionsoptions?): OwnershipCreateResponse { filename, message, valid } | null
POST/{accounts_or_zones}/{account_or_zone_id}/logpush/ownership
Validate ownership challenge
client.logpush.ownership.validate(OwnershipValidateParams { destination_conf, ownership_challenge, account_id, zone_id } params, RequestOptionsoptions?): OwnershipValidation { valid } | null
POST/{accounts_or_zones}/{account_or_zone_id}/logpush/ownership/validate
ModelsExpand Collapse
OwnershipValidation { valid }
valid?: boolean
OwnershipCreateResponse { filename, message, valid }
filename?: string
message?: string
valid?: boolean

LogpushValidate

Validate destination
client.logpush.validate.destination(ValidateDestinationParams { destination_conf, account_id, zone_id } params, RequestOptionsoptions?): ValidateDestinationResponse { message, valid } | null
POST/{accounts_or_zones}/{account_or_zone_id}/logpush/validate/destination
Check destination exists
client.logpush.validate.destinationExists(ValidateDestinationExistsParams { destination_conf, account_id, zone_id } params, RequestOptionsoptions?): ValidateDestinationExistsResponse { exists } | null
POST/{accounts_or_zones}/{account_or_zone_id}/logpush/validate/destination/exists
Validate origin
client.logpush.validate.origin(ValidateOriginParams { logpull_options, account_id, zone_id } params, RequestOptionsoptions?): ValidateOriginResponse { message, valid } | null
POST/{accounts_or_zones}/{account_or_zone_id}/logpush/validate/origin
ModelsExpand Collapse
ValidateDestinationResponse { message, valid }
message?: string
valid?: boolean
ValidateDestinationExistsResponse { exists }
exists?: boolean
ValidateOriginResponse { message, valid }
message?: string
valid?: boolean