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}
Updates a Logpush job.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Update Logpush job
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const logpushJob = await client.logpush.jobs.update(1, {
account_id: 'account_id',
destination_conf: 's3://mybucket/logs?region=us-west-2',
filter:
'{"where":{"and":[{"key":"ClientRequestPath","operator":"contains","value":"/static"},{"key":"ClientRequestHost","operator":"eq","value":"example.com"}]}}',
max_upload_bytes: 5000000,
max_upload_interval_seconds: 30,
max_upload_records: 1000,
output_options: {
'CVE-2021-44228': false,
batch_prefix: '',
batch_suffix: '',
field_delimiter: ',',
field_names: ['Datetime', 'DstIP', 'SrcIP'],
output_type: 'ndjson',
record_delimiter: '',
record_prefix: '{',
record_suffix: '}\n',
sample_rate: 1,
timestamp_format: 'unixnano',
},
ownership_challenge: '00000000000000000000',
});
console.log(logpushJob.id);{
"errors": [],
"messages": [],
"result": {
"dataset": "gateway_dns",
"destination_conf": "s3://mybucket/logs?region=us-west-2",
"enabled": false,
"error_message": null,
"filter": "{\"where\":{\"and\":[{\"key\":\"ClientRequestPath\",\"operator\":\"contains\",\"value\":\"/static\"},{\"key\":\"ClientRequestHost\",\"operator\":\"eq\",\"value\":\"example.com\"}]}}",
"id": 1,
"kind": "",
"last_complete": null,
"last_error": null,
"max_upload_bytes": 5000000,
"max_upload_interval_seconds": 30,
"max_upload_records": 1000,
"name": "example.com",
"output_options": {
"CVE-2021-44228": false,
"batch_prefix": "",
"batch_suffix": "",
"field_delimiter": ",",
"field_names": [
"Datetime",
"DstIP",
"SrcIP"
],
"output_type": "ndjson",
"record_delimiter": "",
"record_prefix": "{",
"record_suffix": "}\n",
"sample_rate": 1,
"timestamp_format": "unixnano"
}
},
"success": true
}Returns Examples
{
"errors": [],
"messages": [],
"result": {
"dataset": "gateway_dns",
"destination_conf": "s3://mybucket/logs?region=us-west-2",
"enabled": false,
"error_message": null,
"filter": "{\"where\":{\"and\":[{\"key\":\"ClientRequestPath\",\"operator\":\"contains\",\"value\":\"/static\"},{\"key\":\"ClientRequestHost\",\"operator\":\"eq\",\"value\":\"example.com\"}]}}",
"id": 1,
"kind": "",
"last_complete": null,
"last_error": null,
"max_upload_bytes": 5000000,
"max_upload_interval_seconds": 30,
"max_upload_records": 1000,
"name": "example.com",
"output_options": {
"CVE-2021-44228": false,
"batch_prefix": "",
"batch_suffix": "",
"field_delimiter": ",",
"field_names": [
"Datetime",
"DstIP",
"SrcIP"
],
"output_type": "ndjson",
"record_delimiter": "",
"record_prefix": "{",
"record_suffix": "}\n",
"sample_rate": 1,
"timestamp_format": "unixnano"
}
},
"success": true
}