jobs
Creates, updates, deletes, gets or lists a jobs resource.
Overview
| Name | jobs |
| Type | Resource |
| Id | cloudflare.logpush.jobs |
Fields
The following fields are returned by SELECT queries:
- get_by_account
- get_by_zone
Get Logpush job details response.
| Name | Datatype | Description |
|---|---|---|
id | integer | Unique id of the job. |
name | string | 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. (example: example.com) |
dataset | string | Name of the dataset. A list of supported datasets can be found on the Developer Docs. (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, email_security_post_delivery_events, firewall_events, gateway_dns, gateway_http, gateway_network, http_requests, ipsec_logs, magic_ids_detections, mcp_portal_logs, 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) (default: http_requests, example: http_requests) |
destination_conf | string (uri) | Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included. (example: s3://mybucket/logs?region=us-west-2) |
enabled | boolean | Flag that indicates if the job is enabled. |
error_message | string | 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. |
frequency | string | 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. (high, low) (default: high, example: high) |
kind | string | The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset). (, edge) (default: , example: , x-stainless-terraform-configurability: computed_optional) |
last_complete | string (date-time) | 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. |
last_error | string (date-time) | 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. |
logpull_options | string (uri-reference) | 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. (example: fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339) |
max_upload_bytes | integer | 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. (0) |
max_upload_interval_seconds | integer | 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. (0) |
max_upload_records | integer | 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. (0) |
output_options | object | The structured replacement for logpull_options. When including this field, the logpull_option field will be ignored. |
Get Logpush job details response.
| Name | Datatype | Description |
|---|---|---|
id | integer | Unique id of the job. |
name | string | 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. (example: example.com) |
dataset | string | Name of the dataset. A list of supported datasets can be found on the Developer Docs. (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, email_security_post_delivery_events, firewall_events, gateway_dns, gateway_http, gateway_network, http_requests, ipsec_logs, magic_ids_detections, mcp_portal_logs, 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) (default: http_requests, example: http_requests) |
destination_conf | string (uri) | Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included. (example: s3://mybucket/logs?region=us-west-2) |
enabled | boolean | Flag that indicates if the job is enabled. |
error_message | string | 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. |
frequency | string | 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. (high, low) (default: high, example: high) |
kind | string | The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset). (, edge) (default: , example: , x-stainless-terraform-configurability: computed_optional) |
last_complete | string (date-time) | 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. |
last_error | string (date-time) | 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. |
logpull_options | string (uri-reference) | 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. (example: fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339) |
max_upload_bytes | integer | 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. (0) |
max_upload_interval_seconds | integer | 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. (0) |
max_upload_records | integer | 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. (0) |
output_options | object | The structured replacement for logpull_options. When including this field, the logpull_option field will be ignored. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_by_account | select | job_id, account_id | Gets the details of a Logpush job. | |
get_by_zone | select | job_id, zone_id | Gets the details of a Logpush job. | |
create_by_account | insert | account_id, destination_conf | Creates a new Logpush job for an account or zone. | |
create_by_zone | insert | zone_id, destination_conf | Creates a new Logpush job for an account or zone. | |
update_by_account | replace | job_id, account_id | Updates a Logpush job. | |
update_by_zone | replace | job_id, zone_id | Updates a Logpush job. | |
delete_by_account | delete | job_id, account_id | Deletes a Logpush job. | |
delete_by_zone | delete | job_id, zone_id | Deletes a Logpush job. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
job_id | string | The job ID. |
zone_id | string | The Cloudflare zone ID. |
SELECT examples
- get_by_account
- get_by_zone
Gets the details of a Logpush job.
SELECT
id,
name,
dataset,
destination_conf,
enabled,
error_message,
frequency,
kind,
last_complete,
last_error,
logpull_options,
max_upload_bytes,
max_upload_interval_seconds,
max_upload_records,
output_options
FROM cloudflare.logpush.jobs
WHERE job_id = '{{ job_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;
Gets the details of a Logpush job.
SELECT
id,
name,
dataset,
destination_conf,
enabled,
error_message,
frequency,
kind,
last_complete,
last_error,
logpull_options,
max_upload_bytes,
max_upload_interval_seconds,
max_upload_records,
output_options
FROM cloudflare.logpush.jobs
WHERE job_id = '{{ job_id }}' -- required
AND zone_id = '{{ zone_id }}' -- required
;
INSERT examples
- create_by_account
- create_by_zone
- Manifest
Creates a new Logpush job for an account or zone.
INSERT INTO cloudflare.logpush.jobs (
dataset,
destination_conf,
enabled,
filter,
frequency,
kind,
logpull_options,
max_upload_bytes,
max_upload_interval_seconds,
max_upload_records,
name,
output_options,
ownership_challenge,
account_id
)
SELECT
'{{ dataset }}',
'{{ destination_conf }}' /* required */,
{{ enabled }},
'{{ filter }}',
'{{ frequency }}',
'{{ kind }}',
'{{ logpull_options }}',
{{ max_upload_bytes }},
{{ max_upload_interval_seconds }},
{{ max_upload_records }},
'{{ name }}',
'{{ output_options }}',
'{{ ownership_challenge }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
Creates a new Logpush job for an account or zone.
INSERT INTO cloudflare.logpush.jobs (
dataset,
destination_conf,
enabled,
filter,
frequency,
kind,
logpull_options,
max_upload_bytes,
max_upload_interval_seconds,
max_upload_records,
name,
output_options,
ownership_challenge,
zone_id
)
SELECT
'{{ dataset }}',
'{{ destination_conf }}' /* required */,
{{ enabled }},
'{{ filter }}',
'{{ frequency }}',
'{{ kind }}',
'{{ logpull_options }}',
{{ max_upload_bytes }},
{{ max_upload_interval_seconds }},
{{ max_upload_records }},
'{{ name }}',
'{{ output_options }}',
'{{ ownership_challenge }}',
'{{ zone_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: jobs
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the jobs resource.
- name: zone_id
value: "{{ zone_id }}"
description: Required parameter for the jobs resource.
- name: dataset
value: "{{ dataset }}"
description: |
Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).
valid_values: ['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', 'email_security_post_delivery_events', 'firewall_events', 'gateway_dns', 'gateway_http', 'gateway_network', 'http_requests', 'ipsec_logs', 'magic_ids_detections', 'mcp_portal_logs', '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']
default: http_requests
- name: destination_conf
value: "{{ destination_conf }}"
description: |
Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.
- name: enabled
value: {{ enabled }}
description: |
Flag that indicates if the job is enabled.
default: false
- name: filter
value: "{{ filter }}"
description: |
The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).
- name: frequency
value: "{{ frequency }}"
description: |
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.
valid_values: ['high', 'low']
default: high
- name: kind
value: "{{ kind }}"
description: |
The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).
valid_values: ['', 'edge']
default:
- name: logpull_options
value: "{{ logpull_options }}"
description: |
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.
- name: max_upload_bytes
value: {{ max_upload_bytes }}
description: |
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.
valid_values: ['0']
- name: max_upload_interval_seconds
value: {{ max_upload_interval_seconds }}
description: |
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.
valid_values: ['0']
- name: max_upload_records
value: {{ max_upload_records }}
description: |
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.
valid_values: ['0']
- name: name
value: "{{ name }}"
description: |
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.
- name: output_options
description: |
The structured replacement for `logpull_options`. When including this field, the `logpull_option` field will be ignored.
value:
CVE-2021-44228: {{ CVE-2021-44228 }}
batch_prefix: "{{ batch_prefix }}"
batch_suffix: "{{ batch_suffix }}"
field_delimiter: "{{ field_delimiter }}"
field_names:
- "{{ field_names }}"
merge_subrequests: {{ merge_subrequests }}
output_type: "{{ output_type }}"
record_delimiter: "{{ record_delimiter }}"
record_prefix: "{{ record_prefix }}"
record_suffix: "{{ record_suffix }}"
record_template: "{{ record_template }}"
sample_rate: {{ sample_rate }}
timestamp_format: "{{ timestamp_format }}"
- name: ownership_challenge
value: "{{ ownership_challenge }}"
description: |
Ownership challenge token to prove destination ownership.
REPLACE examples
- update_by_account
- update_by_zone
Updates a Logpush job.
REPLACE cloudflare.logpush.jobs
SET
destination_conf = '{{ destination_conf }}',
enabled = {{ enabled }},
filter = '{{ filter }}',
frequency = '{{ frequency }}',
kind = '{{ kind }}',
logpull_options = '{{ logpull_options }}',
max_upload_bytes = {{ max_upload_bytes }},
max_upload_interval_seconds = {{ max_upload_interval_seconds }},
max_upload_records = {{ max_upload_records }},
name = '{{ name }}',
output_options = '{{ output_options }}',
ownership_challenge = '{{ ownership_challenge }}'
WHERE
job_id = '{{ job_id }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;
Updates a Logpush job.
REPLACE cloudflare.logpush.jobs
SET
destination_conf = '{{ destination_conf }}',
enabled = {{ enabled }},
filter = '{{ filter }}',
frequency = '{{ frequency }}',
kind = '{{ kind }}',
logpull_options = '{{ logpull_options }}',
max_upload_bytes = {{ max_upload_bytes }},
max_upload_interval_seconds = {{ max_upload_interval_seconds }},
max_upload_records = {{ max_upload_records }},
name = '{{ name }}',
output_options = '{{ output_options }}',
ownership_challenge = '{{ ownership_challenge }}'
WHERE
job_id = '{{ job_id }}' --required
AND zone_id = '{{ zone_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete_by_account
- delete_by_zone
Deletes a Logpush job.
DELETE FROM cloudflare.logpush.jobs
WHERE job_id = '{{ job_id }}' --required
AND account_id = '{{ account_id }}' --required
;
Deletes a Logpush job.
DELETE FROM cloudflare.logpush.jobs
WHERE job_id = '{{ job_id }}' --required
AND zone_id = '{{ zone_id }}' --required
;