-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Question: HTTP Output and Kubernetes / RecordModifier Filters #579
Comments
Thinking out loud, for Part 1 maybe the HTTP Output could support
There is currently a https://github.com/fluent/fluent-bit/blob/master/plugins/out_http/http.c#L124
|
@brandoncole I originally implemented the json_streaming feature for an advanced scenario for sending logs to the Splunk HEC. Your PR in #581 seems reasonable from my view to solve your first issue. For issue 2, please checkout #531 which may fit your needs. An example on how you might use the nest plugin:
This will prefix all fields in the kubernetes metadata. Your example fields would become:
Then you can now easily apply a whitelist. |
@ffscl thanks for the feedback on #581 and the I was looking through the source code for the Kubernetes filter and also found it had an undocumented option Annotations
That got me 80% of the way there, and combined with what you posted above, will work perfect. |
based on https://github.com/fluent/fluent-bit/blob/master/plugins/filter_kubernetes/kube_conf.c#L54 and fluent/fluent-bit#579 (comment) and tested it on my kubernetes cluster.
based on https://github.com/fluent/fluent-bit/blob/master/plugins/filter_kubernetes/kube_conf.c#L54 and fluent/fluent-bit#579 (comment) and tested it on my kubernetes cluster. Signed-off-by: varun <varun.tamminedi@digitalasset.com>
based on https://github.com/fluent/fluent-bit/blob/master/plugins/filter_kubernetes/kube_conf.c#L54 and fluent/fluent-bit#579 (comment) and tested it on my kubernetes cluster. Signed-off-by: varun <varun.tamminedi@digitalasset.com>
…luent#580) Signed-off-by: Patrick Stephens <patrick.stephens@couchbase.com>
I’m trying to use Fluent-Bit to send our log data from a Kubernetes Cluster to Loggly. I’ve used FluentD in the past but I’m really enamored with Fluent-Bit because of the simplistic components that can be pieced together in novel ways and inclusion of things like CPU, Memory and Disk utilization.
Part 1 - Roadblock with HTTP Output
https://fluentbit.io/documentation/current/output/http.html
There’s one roadblock I’m facing right now that there might be a solution for that I wanted to ask about. Loggly expects bulk uploads ( https://www.loggly.com/docs/http-bulk-endpoint/ ) of log data to be sent on separate lines, but when using the HTTP module to send JSON (vs. MSGPACK) it creates a message with a single line consisting of an array with multiple entries like:
Is there a way to easily transform this into:
Alternatively there is an endpoint to send single lines ( https://www.loggly.com/docs/http-endpoint/ ) - although that might be a bit too chatty but I also can't find a way to force Fluent-Bit to send a single line at a time.
Part 2 - Proper Way Of Subsetting K8s Fields
https://fluentbit.io/documentation/current/filter/kubernetes.html
https://fluentbit.io/documentation/current/filter/record_modifier.html
We use the awesome Kubernetes Filter but have a lot of K8s annotations on our pods, and this is a nice to have to cut down on log volume. We looked into using the Record Modifier with the Kubernetes Filter to prune down the output to only the fields we cared about. We were having a bit of trouble getting the configuration exactly how we wanted, but curious whether a subset of the K8s data should be specified by improvements to the Kubernetes Filter or Record Modifier as a more general approach?
The text was updated successfully, but these errors were encountered: