Get Logpush job details
client.Logpush.Jobs.Get(ctx, jobID, query) (*LogpushJob, error)
GET/{accounts_or_zones}/{account_or_zone_id}/logpush/jobs/{job_id}
Gets the details of 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)
Get Logpush job details
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/logpush"
"github.com/cloudflare/cloudflare-go/option"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
logpushJob, err := client.Logpush.Jobs.Get(
context.TODO(),
int64(1),
logpush.JobGetParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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
}