Logpush Job Destinations, Ownership and API Configuration
How to create Logpush jobs, prove destination ownership, configure output options and filters, and deliver logs to storage or SIEM.
This page summarises Cloudflare documentation on Logpush: pushing product metadata in batches to your storage, SIEM, or HTTP endpoint. You configure a job (dataset, destination, fields, filters); Cloudflare delivers logs as soon as possible after the job is enabled.
Logpush jobs: what you configure
Section titled “Logpush jobs: what you configure”A Logpush job ties together a dataset (for example http_requests, audit_logs, workers_trace_events), a destination (destination_conf), optional output_options (fields, timestamps, sampling, format), and optional filter JSON. Jobs are created at account or zone scope; the API path depends on whether the dataset is account-scoped or zone-scoped.
The table below summarizes the job operations available for both Logpush and Edge Log Delivery jobs. Account-scoped datasets use
/accounts/{account_id}, and zone-scoped datasets use/zones/{zone_id}.— Cloudflare, API configuration
The HTTP requests and Firewall events datasets support both scopes. To collect logs from every zone in an account, create an account-scoped job and use the ZoneName field to identify the source zone in each entry.
| Scope | API base (jobs) | Typical datasets |
|---|---|---|
| Zone | /zones/{zone_id}/logpush/jobs |
http_requests, many zone datasets |
| Account | /accounts/{account_id}/logpush/jobs |
Audit Logs v2, Magic IDS (magic_ids_detections), multi-zone HTTP via ZoneName |
Default limit: up to four jobs per dataset per domain, with more possible depending on plan (Enable other providers).
Create a Logpush job: dashboard vs API
Section titled “Create a Logpush job: dashboard vs API”Logpush dashboard: create job flow
Section titled “Logpush dashboard: create job flow”In the Cloudflare dashboard, open Logpush at account or zone level, choose Create a Logpush job, pick a destination, complete destination details, select the dataset, then set job name, filters, fields, and advanced options (timestamp format, sampling, CVE-2021-44228 redaction). Destination-specific steps are in Enable destinations (for example Amazon S3, Cloudflare R2, HTTP).
Zero Trust logs use Cloudflare One Insights > Logs > Manage Logpush; see Logpush integration.
Logpush API: CRUD and token permissions
Section titled “Logpush API: CRUD and token permissions”The Logpush API uses standard CRUD on the jobs endpoints documented in API configuration. At least one of Logs Write, List Logpush jobs, or operation-specific Logpush permissions is required.
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/logpush/jobs" \ --request GET \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"New jobs are enabled: false until you update them. After enabling, logs usually arrive within minutes, then in batches; high-volume zones may wait hours for the first delivery (Manage Logpush with cURL).
Ownership challenge: when Logpush requires it
Section titled “Ownership challenge: when Logpush requires it”Which destinations need an ownership challenge?
Section titled “Which destinations need an ownership challenge?”The ownership challenge proves you can read the destination before Cloudflare writes logs—mainly to prevent mis-pointing a job at someone else’s bucket.
The ownership challenge is a one-time verification that proves you have read access to a destination bucket before Cloudflare pushes logs to it.
— Cloudflare, Ownership challenge FAQ
| Destination type | Ownership challenge |
|---|---|
| AWS S3, GCS, Azure, Sumo Logic | Yes (S3 may use IAM role instead of bucket policy principal) |
| S3-compatible, HTTP, Datadog, Splunk, New Relic | No |
How to complete the ownership challenge
Section titled “How to complete the ownership challenge”POSTto/logpush/ownershipwith the samedestination_confyou will use for the job (API configuration).- Open the
ownership-challenge-*.txtfile Cloudflare wrote to the destination and copy the token (Manage Logpush with cURL). - Create the job with
ownership_challengeset to that token, then enable the job.
Changing destination_conf on an existing job requires a new ownership challenge (Manage Logpush with cURL). You can delete the challenge file after the job is created (Ownership challenge FAQ).
destination_conf: schemes and HTTP headers
Section titled “destination_conf: schemes and HTTP headers”destination_conf uses the form <scheme>://<destination-address> with query parameters for auth and options (API configuration).
Supported schemes include r2, gs, s3, sumo, https, azure, splunk, sentinelone, datadog, kinesis, bq, and others. Examples:
- S3:
s3://bucket/[dir]?region=<REGION>— optional{DATE}in the path for daily folders (API configuration) - R2:
r2://<BUCKET_PATH>/{DATE}?account-id=...&access-key-id=...&secret-access-key=...(Enable Cloudflare R2) - HTTP / SIEM: any URL parameter starting with
header_becomes an HTTP header (Enable HTTP destination)
As of May 2022, defining a unique destination for a Logpush job will no longer be required. As this constraint has been removed, you can now have more than one job writing to the same destination.
— Cloudflare, API configuration
For dedicated egress IP HTTP setups, proxy the endpoint in a zone and protect it with a secret header_* and WAF, or Cloudflare Access service tokens (Dedicated Egress IP for Logpush).
output_options and filters: fields, format, volume
Section titled “output_options and filters: fields, format, volume”output_options: replace logpull_options
Section titled “output_options: replace logpull_options”Jobs should use output_options (not deprecated logpull_options). It controls field_names, timestamp_format (unixnano, unix, rfc3339, etc.), sample_rate, output type (ndjson, csv, templates), and CVE-2021-44228 redaction (Log Output Options).
Dashboard updates may clear CVE-2021-44228; that flag is API-only today (API configuration). For New Relic, use timestamp_format: unix (Enable New Relic). For BigQuery, prefer rfc3339 and set stringify_object when using custom formatting (Enable Google BigQuery).
Custom fields in Logpush output
Section titled “Custom fields in Logpush output”Include Cookies, RequestHeaders, ResponseHeaders, and/or ResponseFields in output_options.field_names when custom field rules expose those values (Custom fields). Cloudflare Access users must add cf-access-user via custom fields and include RequestHeaders in the job.
Logpush filters and sampling
Section titled “Logpush filters and sampling”Filters are JSON strings with where clauses (key, operator, value); combine with and / or in the API or If logs match in the dashboard (Filters).
Using filters, you can send set sample rates (or not include logs altogether) based on filter criteria.
— Cloudflare, Hostname analytics
Filtering is available for all datasets, but not on object / array[object] types, and several Firewall events fields are unsupported for filtering (Hostname analytics). Sampling in output_options applies on top of filters (Log Output Options).
Edge Log Delivery and kind parameter
Section titled “Edge Log Delivery and kind parameter”Optional "kind": "edge" creates Edge Log Delivery (only http_requests today). kind cannot be used to update existing Logpush jobs—only at create time (API configuration).
Destination patterns (without full walkthroughs)
Section titled “Destination patterns (without full walkthroughs)”| Goal | Where to start |
|---|---|
| Long-term storage (S3, GCS, Azure, R2) | Enable Amazon S3, Enable Google Cloud Storage, Enable Microsoft Azure, Enable Cloudflare R2 |
| SIEM / observability | Enable Datadog, Enable Splunk, Enable New Relic |
| Streaming on AWS | Enable Amazon Kinesis |
| Custom HTTP collector | Enable HTTP destination |
| In-account analytics pipeline | Enable Basin Pipelines |
AWS S3 notes: Cloudflare’s IAM user arn:aws:iam::391854517948:user/cloudflare-logpush needs PutObject on your prefix; China regions are unsupported; SSE-KMS usually requires an IAM role in your account, not sse=AES256 in destination_conf (Enable Amazon S3). Azure SAS must be blob-only (ss=b), object-only (srt=o), write-only, long expiry (Enable Microsoft Azure).
Audit Logs v2 needs a separate job from v1; the dataset is account-based (Audit Logs). Magic IDS uses dataset: magic_ids_detections at /accounts/{account_id}/... (IDS logs).
Common Logpush mistakes
Section titled “Common Logpush mistakes”- Enabling the job but never checking
last_completeorlast_erroronGET .../logpush/jobs/{job_id}(Manage Logpush with cURL). - Partial
PUTonoutput_options, accidentally resetting timestamp format or fields (Log Output Options). - Firewall events filters using fields Cloudflare excludes from filtering (for example
RuleID,Action) (Hostname analytics). - HTTP destination failing validation because the endpoint cannot accept the test gzip upload (
{"content":"tests"}) (Enable HTTP destination). - Zero Trust Logpush with a token that has Logs Edit but not Zero Trust: PII Read (error
1004) (Permissions). - Assuming log retention API is the same as Logpush—retention uses
/zones/{zone_id}/logs/control/retention/flag(Enabling log retention).
How to check this on your site
Section titled “How to check this on your site”- Confirm your role or API token includes Logs Write (and Zero Trust: PII Read for Access/Gateway/DEX datasets) via Permissions and your Cloudflare dashboard Members settings for Workers/R2 jobs (Workers Logpush).
GETthe job at/zones/{zone_id}/logpush/jobs/{job_id}or the account equivalent; verifyenabledis true and watchlast_completeadvance (Manage Logpush with cURL).- For storage destinations, confirm new objects or batches at your prefix (after ownership challenge, if required—Ownership challenge FAQ).
- For Splunk HEC, run a pre-flight
curlwithout skipping TLS verify before creating the job (Enable Splunk). - You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page does not match your setup or the official docs, email yimasynthetic@gmail.com with the page URL and the exact sentence you are questioning.