-
Notifications
You must be signed in to change notification settings - Fork 133
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
Feature request: partial_message concat #25
Comments
@gbleu This is a Fluent Bit core feature request; I believe it's covered by this issue: fluent/fluent-bit#337 |
Hi @PettitWesley we are currently facing the same issue @gbleu was already facing. I have learned that there is a docker_mode for exactly our problem when using tail input in fluent bit. In the meantime ist there a solution I can pick up? |
@kaisermario Unfortunately I am not aware of a solution with Fluent Bit right now. Fluentd has a concat filter though which can be used to concatenate messages, and could solve this use case: https://github.com/fluent-plugins-nursery/fluent-plugin-concat |
Hi @PettitWesley , |
@kaisermario The community vends these on Docker Hub, or you can fork the code and add any plugins you need: https://github.com/fluent/fluentd-kubernetes-daemonset Looks like filter concat is installed: https://github.com/fluent/fluentd-kubernetes-daemonset/blob/master/docker-image/v1.9/debian-cloudwatch/Gemfile Docker Hub is here: https://hub.docker.com/r/fluent/fluentd-kubernetes-daemonset/ |
Hi @PettitWesley, we do not use kubernetes - but It should be possible to easily create an image by our own. |
@kaisermario I think you can probably use the Kubernetes images outside of Kubernetes- just change the configuration file. |
Hi @PettitWesley, Logs show: 2020-08-27T14:23:26.990+02:00 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.10.4/lib/fluent/config/literal_parser.rb:141:in `scan_nonquoted_string': stack level too deep (SystemStackError) 2020-08-27T14:23:26.991+02:00 from /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.10.4/lib/fluent/config/literal_parser.rb:86:in `scan_string' 2020-08-27T14:23:26.991+02:00 from /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.10.4/lib/fluent/config/literal_parser.rb:75:in `parse_literal' 2020-08-27T14:23:26.991+02:00 from /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.10.4/lib/fluent/config/v1_parser.rb:115:in `parse_element' 2020-08-27T14:23:26.991+02:00 from /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.10.4/lib/fluent/config/v1_parser.rb:95:in `parse_element' 2020-08-27T14:23:26.991+02:00 from /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.10.4/lib/fluent/config/v1_parser.rb:168:in `block in eval_include' 2020-08-27T14:23:26.991+02:00 from /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.10.4/lib/fluent/config/v1_parser.rb:162:in `each' 2020-08-27T14:23:26.991+02:00 from /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.10.4/lib/fluent/config/v1_parser.rb:162:in `eval_include' 2020-08-27T14:23:26.991+02:00 from /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.10.4/lib/fluent/config/v1_parser.rb:145:in `parse_include' 2020-08-27T14:23:26.991+02:00 ... 8178 levels... 2020-08-27T14:23:26.991+02:00 from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require' 2020-08-27T14:23:26.991+02:00 from /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.10.4/bin/fluentd:8:in `<top (required)>' 2020-08-27T14:23:26.991+02:00 from /usr/bin/fluentd:23:in `load' 2020-08-27T14:23:26.991+02:00 from /usr/bin/fluentd:23:in Do you have an idea? I am desperate... Thanks. |
@kaisermario Can you share your full Fluentd configuration and Dockerfile. |
I am not sure if Still, I see lots of examples online on how to do this: |
Hi @PettitWesley , In the meantime I took this step. Currently this is my fluentd conf:
The goal was to achive a concatenation of splitted logs by docker daemon. Environment: Fargate 1.3, Firelens Reading all issues here https://github.com/fluent-plugins-nursery/fluent-plugin-concat I think this issue is poorly understood by many. Any ideas? Cheers |
Haven't looked at your config yet, but I checked and (as you also saw) partial_message field from docker is supported in FireLens. |
I think its worth re-opening this issue to track the feature request for concat in Fluent Bit, and for debugging @kaisermario issue. |
btw. fluentd-concat-plugin seems to work not properly and also not beeing maintained actively... |
Any update on this? |
No hard timeline or promise, but I suspect we would get around to implementing and releasing this in the first quarter of next year |
Thanks for the response. In the mean time, do you know if there is a working example for joining partial messages from ECS using a custom fluent confit? |
@bpottier Here's the FireLens example which uses It shows using a regular expression to match multiline logs. You'd want to to use the
If this is true though then we're all out of luck. I'd be very surprised if the fluent concat plugin didn't work though; the Fluentd community is huge and its usage still is larger than Fluent Bit. I haven't had time to play with it myself yet though and check if it works. |
@PettitWesley I was never able to get the logs to re-join on the partial_message key. Thanks for the help though. It's probably worth mentioning for anyone who stumbles across this issue that AWS Fargate platform version 1.4.0 uses containerd instead of Docker and the partial_message key is no longer added to the log message when the size exceeds 16K. |
Any update on this? |
Good news, now available in Fluent Bit v1.8 fluent/fluent-bit/issues/337#issuecomment-882953961 |
So @gbleu does new fluent-bit multiline filter work for you? I was trying to use it for your containers with long logs, but nothing changed. Logs are still split by multiple messages. We run java services in a container and they write logs in JSON format. So docker logs should look like this And I used the next fluent-bit config
Fluent Bit v1.8.3� I expected that will concatenate the message, but instead of that we've got 2 logs: Could someone help me with this? Am I doing something wrong or missing something? Or multiline parser is not correctly working for our case? Thanks in advance |
I just also tried on a simple setup. But if we send logs from Fargate service via Firelens to fluent-bit (with multiline filter) and then again to another fluent-bit (with multiline filter) and then to somewhere else. Logs are concatenating after the second fluent-bit |
@opteemister the same issue for me. Fargate logs are not concatenated using multiline filter. Note that if you use Fargate 1.4+ then it's using a containerd runtime and you should use |
How did your journey with fluentd end? Have you tried with CRI's logtag instead of docker's partial_message? (Fargate 1.4+ seems to be CRI) |
@f0o Fargate 1.4 should not be using CRI format logs in ECS, we use this package which wraps the docker log driver code: https://github.com/aws/amazon-ecs-shim-loggers-for-containerd |
@PettitWesley It would solve all problems for everyone. |
On the Fluent Bit side, I have started working on this. ETA is ~1 month. On the Fargate side, I opened a public issue to track (no ETA available): aws/containers-roadmap#1550 |
Yes, this is true. However, I suspect we will find that it's much easier to implement using the standard method of having the runtime emit a partial message identifier and then use a log agent (Fluent Bit) to concatenate them. This is better from a buffering standpoint. I don't want the container runtime to be buffering huge logs and then trying to send them to Fluent Bit. I'd rather stream it small logs and then have it worry about the buffering. |
Hey folks! Great News! I finally got around to implementing this! And here's a pre-release image you can use:
Here's an example config:
Basically, you use the multiline filter which now has two modes, Let me know what you think. Thanks! |
@PettitWesley I'm unable to pull the image. Is it public? |
Any guesstimate on when |
@f0o The partial message fluent bit support should be released in AWS for Fluent Bit soon once we uptake 1.9.3. As far as the PV 1.4 work goes, that is currently a work in progress and should release very soon, but I can't publicly given any exact date. |
@gschelter sorry missed your comment, You need to be logged into ECR. I would recommend using ECS-CLI. However, you can now just use the 1.9.3 upstream Fluent Bit image from docker hub to test this feature. This will be released in AWS for Fluent bit soon. |
This is implemented in the latest release: https://github.com/aws/aws-for-fluent-bit/releases/tag/v2.24.0 FireLens example will be merged shortly: aws-samples/amazon-ecs-firelens-examples#65 The feature request is implemented, so closing this issue. We prefer you open a new issue if you have problems using the feature. |
Docker logs are split into several parts with
partial_message
when exceeding a certain size, json logs ends up broken and not indexed properly.The text was updated successfully, but these errors were encountered: