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
adds host and path to structured log formats #916
Conversation
Thanks for your pull request! 📣 Looks good so far. Just one thing to add: Another idea, while we're at it: What about scheme, port and query? If we break down the request uri into its components, why not apply it all the way? |
Sorry for missing the docs, I'll definitely update. I also agree that it makes sense to add all of the components. One question, should we be consistent with the |
Good question. I already thought about it. I guess absent would be more consistent with the existing features. But null values or defaults could be easier to use on the log analytics site of things. |
I think it would be reasonable to put |
- update json/splunk format readme docs
Since the other keys are pretty straightforward, I'm thinking we tackle the query params separate from the other simpler fields (happy to follow up with another pr). I was also a little confused by the readme since it mentioned |
Yes, that would be nice.
Sounds good.
I guess it's just out of date with the implementation. Maybe I had this in mind at some point but never implemented it. |
logbook-api/src/main/java/org/zalando/logbook/StructuredHttpLogFormatter.java
Outdated
Show resolved
Hide resolved
logbook-api/src/test/java/org/zalando/logbook/StructuredHttpLogFormatterTest.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Willi Schönborn <w.schoenborn@gmail.com>
@@ -385,7 +389,8 @@ requests and response as key-value pairs. | |||
###### Request | |||
|
|||
```text | |||
origin=remote type=request correlation=2d66e4bc-9a0d-11e5-a84c-1f39510f0d6b protocol=HTTP/1.1 sender=127.0.0.1 method=POST path=http://example.org/test headers={Accept=[application/json], Content-Type=[text/plain]} body=Hello world! | |||
origin=remote type=request correlation=2d66e4bc-9a0d-11e5-a84c-1f39510f0d6b protocol=HTTP/1.1 sender=127.0.0.1 method=POST uri=http://example.org/test host=example.org scheme=http port=null path=/test headers={Accept=[application/json], Content-Type=[text/plain]} body=Hello world! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not an expert on splunk - maybe an empty value would be cleaner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 |
Thanks for your contribution! 🎉 I'll wait for your other PRs to make one big release, unless you need it faster. |
@whiskeysierra thanks! I think I should have bandwidth to finish our open prs and propose something for the query params. |
Proposed change for #915
Types of changes
Checklist: