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
LogpushFilter support #915
LogpushFilter support #915
Conversation
this PR looks great, thank you! my only hesitation at the moment is the job := cloudflare.LogpushJob{
Name: "example.com static assets",
LogpullOptions: "fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339&CVE-2021-44228=true",
Dataset: "http_requests",
DestinationConf: "s3://<BUCKET_PATH>?region=us-west-2/",
Filter: cloudflare.LogpushJobFilters{
Where: cloudflare.LogpushJobFilter{
And: []cloudflare.LogpushJobFilter{
{Key: "ClientRequestPath", Operator: cloudflare.Contains, Value: "/static\\"},
{Key: "ClientRequestHost", Operator: cloudflare.Equal, Value: "example.com"},
},
},
}
}
however, taking this approach, we'll need a custom marshal handler which may be annoying. WDYT? |
@jacobbednarz It makes a lot of sense to keep the consistency of the library. Let me do some refactoring to add custom marshalling for that field and an extra test to ensure bot Marshalling and Unmarshalling works as expected |
awesome, thanks! other than that, the testing and approach looks ace. |
@jacobbednarz Refactoring done ~ |
Co-authored-by: Jacob Bednarz <jacob.bednarz@hey.com>
Co-authored-by: Jacob Bednarz <jacob.bednarz@hey.com>
Co-authored-by: Jacob Bednarz <jacob.bednarz@hey.com>
thank you for the contribution, you rock! 🥇 |
Adds support for
filter
field in LogpushJob as set in hereDescription
Has your change been tested?
Added struct test that matches example in Cloudflare docs
Types of changes
What sort of change does your code introduce/modify?
Checklist: