-
Notifications
You must be signed in to change notification settings - Fork 168
forwarder, others: remove the record size limit #21
Comments
This is likely caused by log lines larger than 64k which is bufios default max token size. |
An alternative would be to store a line length in front of the line so we can know upfront how long the line is. Also, the bigger length error should obviously not panic the process. |
You are correct, there seems to be one huge line among all others. |
Yep, you've stumbled over the record size limit. It's actually baked into various places throughout the system, not only in the forwarder. It's definitely fixable, I've just not taken the time yet. Thanks for filing the issue! |
@peterbourgon have you looked into this yet? We're considering using this for our production systems but we have potentially very long log lines so a fixed record size limit would cause us issues. |
Nope. But I'm happy to turn my attention to it next. Warning: no ETAs ;) Is there a reasonable upper size limit for your use case, after which you'd be willing to accept e.g. truncation? |
I just did a quick search over some of our logs over the past hour or so and the longest line we've emitted is 670620 bytes. I'm somewhat certain I could find longer entries if I searched over the past few days. |
Goodness! Okay. JSON? |
Yeah, the huge lines are mostly comprised of JSON. |
Hi, I ended up with the same problem here. I might be able to help. |
Max size is baked in to several layers in several components, so it's not as easy as just adding a parameter, unfortunately. |
Encountered this one too, tried to move all log backups to oklog, so we can search through them, the average log file size is around 100MB, some 350k+ lines. Got Any ideas how to get around this issue, before max size parameters are implemented? Maybe some tricky stdout-splitting? |
OK so I've tried to fool around with |
We're seeing this now as well. Similarly we are looking at OK Log for general use in our dev/test environments. In this case it's the output from a Jenkins build/test job. Looks to be JSON output as well... |
Thanks for the report. What's the rough max size of your lines? |
In this particular file it looks to be 103046. |
It looks like bufio.Reader should be used according to bufio documentation Scanning stops unrecoverably at EOF, the first I/O error, or a token too large to fit in the buffer. When a scan stops, the reader may have advanced arbitrarily far past the last token. Programs that need more control over error handling or large tokens, or must run sequential scans on a reader, should use bufio.Reader instead. Is it possible changing from Scanner to Reader would work? |
Well, sure, but...
|
When I try to ingest a large log file, the ingester will fail with
bufio.Scanner: token too long
.The text was updated successfully, but these errors were encountered: