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

Proposal: Support nested structures JSON formatted in access_log #12582

Closed
Pchelolo opened this issue Aug 10, 2020 · 5 comments · Fixed by #12602
Closed

Proposal: Support nested structures JSON formatted in access_log #12582

Pchelolo opened this issue Aug 10, 2020 · 5 comments · Fixed by #12602

Comments

@Pchelolo
Copy link
Contributor

Background
The format_json support was implemented in #2692 but it only allows flat single-level objects as JSON output. As I understand from the discussion on the issue, nesting was left out because there was no clear need for it at the time, but the API was designed to be future proof to support it.

Rational
At Wikimedia, we ingest all the access logs into Kafka, funneling them into Hadoop for analytics purposes. All of our logs have a schema, and unluckily, our schema has nested objects. We would like to have envoy access logs conform to the common schema patterns we have.

There are endless possibilities on how to convert flat JSON structure into a nested one when upon ingestion, but by far the cleanest option is to support nested structures in envoy natively to emit the logs in a correct format right away. In the end, I do not see any downsides in supporting nested objects, so the rational could be best described as "why not?".

Proposal
Support nested JSON in format_json access log.

If we provide the implementation/testing/documentation, would this feature be accepted?
cc @aa-stripe as an author of the original patch

@aa-stripe
Copy link
Contributor

I agree, nested objects are totally reasonable, and if you need that support, we should add it natively.

Imo we should definitely avoid any kind of "flatten when emitted, but re-nest upon ingestion type of solution".

I'd be curious of what your specific use case is - what nesting would you like to introduce?

@Pchelolo
Copy link
Contributor Author

I'd be curious of what your specific use case is - what nesting would you like to introduce?

Here is an example of the schema we are using for some other access logs, the one we're planning to use for envoy would be very similar. So eventually the config in our case should look somewhat like this

@mattklein123
Copy link
Member

+1 this sounds like a good thing to add.

@aa-stripe
Copy link
Contributor

:shipit:

zuercher pushed a commit that referenced this issue Aug 21, 2020
Add support for nested JSON format in JSON logging mode.

Risk Level: low, feature only used if nested objects are configured, thus opt-in.
Testing: unit tests
Docs Changes: yes
Release Notes: added
Fixes: #12582

Signed-off-by: Petr Pchelko <ppchelko@wikimedia.org>
@jnwright
Copy link

@Pchelolo Hi! I'm a product designer working at HashiCorp, and I'm researching how we can best show envoy access logs in Consul's UI. I saw your comment above and thought you might be a good person to reach out to. If you aren't interested in them being shown in the UI, though, please feel free to ignore this!

If you are, can you tell me what information from the logs would be most important for you to see in the UI? Also, are these logs something you'd like to see on a per-service basis, or for a whole namespace? Or both?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants