Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No filter for logpush job #5131

Open
3 tasks done
thi-dinh-iconic opened this issue Feb 13, 2025 · 0 comments
Open
3 tasks done

No filter for logpush job #5131

thi-dinh-iconic opened this issue Feb 13, 2025 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. version/5 Categorizes issue or PR as related to version 5 of the provider.

Comments

@thi-dinh-iconic
Copy link

Confirmation

  • This is a bug with an existing resource and is not a feature request or enhancement. Feature requests should be submitted with Cloudflare Support or your account team.
  • I have searched the issue tracker and my issue isn't already found.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Current provider version did not have filter option that can help to reduce the number of unwanted logs

resource "cloudflare_logpush_job" "example_logpush_job" {
  destination_conf = "s3://mybucket/logs?region=us-west-2"
  zone_id = "zone_id"
  dataset = "http_requests"
  enabled = false
  frequency = "high"
  kind = "edge"
  logpull_options = "fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339"
  max_upload_bytes = 5000000
  max_upload_interval_seconds = 30
  max_upload_records = 1000
  name = "example.com"
  output_options = {
    batch_prefix = "batch_prefix"
    batch_suffix = "batch_suffix"
    cve_2021_4428 = true
    field_delimiter = "field_delimiter"
    field_names = ["ClientIP", "EdgeStartTimestamp", "RayID"]
    output_type = "ndjson"
    record_delimiter = "record_delimiter"
    record_prefix = "record_prefix"
    record_suffix = "record_suffix"
    record_template = "record_template"
    sample_rate = 0
    timestamp_format = "unixnano"
  }
  ownership_challenge = "00000000000000000000"
}

While the API had that option https://developers.cloudflare.com/logs/reference/filters/
Could you please help to support it.

Affected resource(s)

cloudflare_logpush_job

Terraform configuration files

resource "cloudflare_logpush_job" "example_logpush_job" {
  destination_conf = "s3://mybucket/logs?region=us-west-2"
  zone_id = "zone_id"
  dataset = "http_requests"
  enabled = false
  frequency = "high"
  kind = "edge"
  logpull_options = "fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339"
  max_upload_bytes = 5000000
  max_upload_interval_seconds = 30
  max_upload_records = 1000
  name = "example.com"
  output_options = {
    batch_prefix = "batch_prefix"
    batch_suffix = "batch_suffix"
    cve_2021_4428 = true
    field_delimiter = "field_delimiter"
    field_names = ["ClientIP", "EdgeStartTimestamp", "RayID"]
    output_type = "ndjson"
    record_delimiter = "record_delimiter"
    record_prefix = "record_prefix"
    record_suffix = "record_suffix"
    record_template = "record_template"
    sample_rate = 0
    timestamp_format = "unixnano"
  }
  ownership_challenge = "00000000000000000000"
}

Link to debug output

N/A

Panic output

No response

Expected output

having filter with nested json format like this

{
  "filter": {
    "where": {
      "and": [
        {
          "key": "ClientRequestPath",
          "operator": "contains",
          "value": "/static"
        },
        {
          "key": "ClientRequestHost",
          "operator": "eq",
          "value": "example.com"
        }
      ]
    }
  }
}

Actual output

no filter allowed

Steps to reproduce

  1. Using the provider
  2. Add logpush_job resources
  3. Run tf plan&apply

Additional factoids

No response

References

No response

@thi-dinh-iconic thi-dinh-iconic added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 13, 2025
@jacobbednarz jacobbednarz added the version/5 Categorizes issue or PR as related to version 5 of the provider. label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. version/5 Categorizes issue or PR as related to version 5 of the provider.
Projects
None yet
Development

No branches or pull requests

2 participants