Skip to content
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

Hope the in_tail Input plugin support limit multiline log's size #3684

Open
wangchaoforever opened this issue Mar 21, 2022 · 4 comments
Open
Labels
enhancement Feature request or improve operations

Comments

@wangchaoforever
Copy link

Is your feature request related to a problem? Please describe.

When I collect logs which single line log's size is about 20M, it cause OOM KILL fluentd in in_tail stage. So I hope to have a parameter to limit single line log's size.
Like collect single line log, When I collect multiline log, the OOM KILL is also happend in in_tail stage. So I hope to have a parameter to limit multiline log's size.

Describe the solution you'd like

I hope to have a parameter to limit the log's size in in_tail step. Just like the filter parameter which I can only keep the 50000 lenth from begin:
<filter *>
@type record_transformer
enable_ruby

message ${if record["message"].to_s.length > 50000 then record["message"][0..50000] else record["message"]; end}

Describe alternatives you've considered

Large single log or multiline logs will expend too much in source in_tail step, I don't want to skip the large log and hope to keep 50000 length. I have no idea to deal with it now.

Additional context

No response

@kenhys
Copy link
Contributor

kenhys commented Mar 22, 2022

I hope that max_line_size will work for you. (It is available since Fluentd v1.14.4)

https://docs.fluentd.org/input/tail#max_line_size

@wangchaoforever
Copy link
Author

wangchaoforever commented Mar 22, 2022

@kenhys I upgrade my fluentd to v1.14.4 and use max_line_size in tail, but the OOM KILL still happend. The logs:

...
2022-03-22 15:36:03 +0800 [info]: starting fluentd-1.14.4 pid=6603 ruby="2.7.5"
2022-03-22 15:36:03 +0800 [info]: spawn command to main:  cmdline=["/opt/td-agent/bin/ruby", "-Eascii-8bit:ascii-8bit", "/opt/td-agent/bin/fluentd", "-c", "/etc/td-agent/td-agent-longlog.conf", "--under-supervisor"]
2022-03-22 15:36:03 +0800 [info]: #0 adding match pattern="test" type="stdout"
2022-03-22 15:36:04 +0800 [info]: #0 adding source type="tail"
2022-03-22 15:36:04 +0800 [info]: #0 starting fluentd worker pid=6608 ppid=6603 worker=0
2022-03-22 15:36:04 +0800 [info]: #0 following tail of /data/log/test/collect-log/test.log
2022-03-22 15:37:10 +0800 [warn]: #0 received line length is longer than 16384
2022-03-22 15:37:10 +0800 [warn]: #0 received line length is longer than 16384
2022-03-22 15:37:10 +0800 [info]: Worker 0 finished unexpectedly with signal SIGKILL
...

@github-actions
Copy link

This issue has been automatically marked as stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days

@github-actions github-actions bot added the stale label Jun 20, 2022
@ashie ashie removed the stale label Jun 20, 2022
@ashie
Copy link
Member

ashie commented Sep 5, 2022

@kenhys I upgrade my fluentd to v1.14.4 and use max_line_size in tail, but the OOM KILL still happend. The logs:

Is it multi line case?
I believe max_line_size will fix the issue for single line case, and in fact you said it's effective in #3739.
On the other hand, probably it won't skip big multi line log consist small single lines and might retain excessive memory.

@ashie ashie added the feature request *Deprecated Label* Use enhancement label in general label Sep 5, 2022
@ashie ashie changed the title Hope the in_tail Input plugin support limit single line log's size and multiline log's size Hope the in_tail Input plugin support limit multiline log's size Sep 5, 2022
@kenhys kenhys added enhancement Feature request or improve operations and removed feature request *Deprecated Label* Use enhancement label in general labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or improve operations
Projects
None yet
Development

No branches or pull requests

3 participants