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
out_http: Add JSON Streaming output format #477
Conversation
int in_escape = FLB_FALSE; | ||
|
||
for (p = json_buf; p!=end; p++) { | ||
if (in_escape) |
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.
what's the function/role of in_escape ?
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.
This skips checking *p if the previous character was an escape character. This addresses the case of:
[{"foo":"bar\""},{"fizz":"buzz\""}]
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
Please make only one commit on top of GIT Master and we will be ready for merge. |
@ffscl ping |
Sorry! Will get this done this week so you can close this. |
https://en.wikipedia.org/wiki/JSON_streaming#Concatenated_JSON This is an independent output format behind flag format=json_stream Useful when flushing to system that doesn't accept msgpack or JSON arrays Signed-off-by: Brendan <brendan.wreford@anz.com>
4948172
to
40a6728
Compare
@edsiper please review now. |
I was looking up at the implementation of this and have another use case for log ingestion where a provider (Loggly) in this case expects JSON separated by newlines. I've created an issue here that summarizes it - thought perhaps I might get some thoughts from @ffscl and @edsiper in the issue below since you both appear to be quite familiar with this area of the code? Thanks! |
Support for concatenated JSON Streaming format.
https://en.wikipedia.org/wiki/JSON_streaming#Concatenated_JSON
This is an independent output format behind flag format=json_stream
Useful when flushing buffer to systems that doesn't accept msgpack or JSON arrays
FYI - I've applied gnu-indent with the apache style guide rules https://httpd.apache.org/dev/styleguide.html