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

add support for custom JSON access log fields #3033

Closed

Conversation

mike1808
Copy link
Contributor

@mike1808 mike1808 commented Oct 15, 2020

Fixes #3032

@xcrezd
Copy link

xcrezd commented Oct 15, 2020

Waiting for this feature

@ndhanushkodi ndhanushkodi force-pushed the extra-json-access-log-fields branch 2 times, most recently from 136aece to 8dd4e39 Compare October 16, 2020 05:18
@codecov
Copy link

codecov bot commented Oct 16, 2020

Codecov Report

Merging #3033 into main will increase coverage by 0.01%.
The diff coverage is 72.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3033      +/-   ##
==========================================
+ Coverage   74.00%   74.01%   +0.01%     
==========================================
  Files          95       95              
  Lines        6081     6089       +8     
==========================================
+ Hits         4500     4507       +7     
- Misses       1479     1480       +1     
  Partials      102      102              
Impacted Files Coverage Δ
cmd/contour/serve.go 0.00% <0.00%> (ø)
cmd/contour/servecontext.go 90.40% <ø> (ø)
internal/xdscache/v2/listener.go 95.10% <0.00%> (ø)
internal/envoy/v2/accesslog.go 100.00% <100.00%> (ø)

To add a custom JSON field, add the key to `json-fields`, and
add the key and value to `custom-json-fields`.

Sample config:
```
json-fields:
  - "custom_field"
custom-json-fields:
  custom_field: "%REQ(CUSTOM-HEADER)%"
```

Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com>

Signed-off-by: Nitya Dhanushkodi <ndhanushkodi@vmware.com>
Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com>
@mike1808 mike1808 changed the title wip: add support for custom JSON access log fields add support for custom JSON access log fields Oct 16, 2020
@mike1808 mike1808 marked this pull request as ready for review October 16, 2020 16:24
@youngnick
Copy link
Member

Thanks for this PR @mike1808! As I said on #3032, I'd like to see some discussion around the concerns there before proceeding with a PR, although this one looks very clean and is a nice bit of work.

I'd like to close this PR and have you open a new one if you're still good to implement @mike1808?

@mike1808
Copy link
Contributor Author

@youngnick sure. I'll close the PR and open a new PR for /design.

@mike1808 mike1808 closed this Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support custom JSON fields for Envoy access logs
4 participants