List Logpush jobs
client.Logpush.Jobs.List(ctx, query) (*SinglePage[LogpushJob], error)
GET/{accounts_or_zones}/{account_or_zone_id}/logpush/jobs
Lists Logpush jobs for an account or zone.
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)
List Logpush jobs
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"),
)
page, err := client.Logpush.Jobs.List(context.TODO(), logpush.JobListParams{
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
{
"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
}