-
Notifications
You must be signed in to change notification settings - Fork 152
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 json_lines webhook input format #100
Conversation
fluent-bit allows two JSON log formats: a stream of JSON objects not separated at all, and one with a single JSON object per line. None of those was compatible with grok_exporter so far. This change implements the json_lines format that is compatible with fluent-bit.
I assume this PR is implementing support for Newline Delimited JSON (ndjson). I think we could consider implementing a
|
Yes, looks like. Although fluent-bit not really calls it that way. fluent-bit allows sending custom headers, so using the header should also be a valid route for us. I'll check next week how fluent-bit really behaves regarding content type headers. I assume a way to "force overwrite" any incoming headers in grok_exporter would be a good thing, anyway. I'm totally fine with providing a new patch taking HTTP headers into account. I didn't know or even expect somebody wrote a spec for newline separated json records. :) But a common naming definitely is a good thing to have. |
I don't know the specifics of the fluent-bit http module, but I imagine it behaves somewhat similar to the fluentd one; which seems to send the header for ndjson, as quoted below:
But yes, I'm not suggesting that
Ofcourse someone wrote a spec for it, it's always nice when things are standardized. |
I have been running this change for a while now, and it seems good and rock stable. 👍 |
Thanks a lot and sorry for the delay. It's merged now. |
fluent-bit allows two JSON log formats: a stream of JSON objects not separated at all,
and one with a single JSON object per line. None of those was compatible with
grok_exporter so far. This change implements the json_lines format that is compatible
with fluent-bit.
I did not implement for v2 config, is this considered deprecated regarding new features or should the change also be included there? Runs fine with
json_lines
configuration and fluent-bit in our integration stage with some millions of log records by now.I'd also be fine adding up some refactoring regarding duplicate code, but I wanted to propose/discuss the change first.