-
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
parser: fix time zone offsets being dropped on Windows #6368
parser: fix time zone offsets being dropped on Windows #6368
Conversation
This adds a unit test for parsing logs that contain time stamps with a time zone offset. This test deliberately fails on Windows; a subsequent commit fixes the underlying issue and makes the test pass. Signed-off-by: Jeff Erbrecht <jefferbrecht@google.com>
This wrapper struct adds an explicit time zone offset field on platforms that do not include such a field within `struct tm`, such as on Windows. This gives us a place to store parsed time zone information so that we don't have to drop it. Signed-off-by: Jeff Erbrecht <jefferbrecht@google.com>
This updates the parser APIs to use flb_tm.. Signed-off-by: Jeff Erbrecht <jefferbrecht@google.com>
This changes the strptime APIs to use flb_tm. Any implementation conditional on FLB_HAVE_GMTOFF has been reverted since flb_tm now has a field to store the time zone offset on all platforms. Signed-off-by: Jeff Erbrecht <jefferbrecht@google.com>
Signed-off-by: Jeff Erbrecht <jefferbrecht@google.com>
Signed-off-by: Jeff Erbrecht <jefferbrecht@google.com>
Signed-off-by: Jeff Erbrecht <jefferbrecht@google.com>
Signed-off-by: Jeff Erbrecht <jefferbrecht@google.com>
Signed-off-by: Jeff Erbrecht <jefferbrecht@google.com>
Example configuration parsers.conf:
fluent-bit command line:
Debug log output (Debian 10)
Debug log output (Windows Server 2019)
valgrind output
Note: The same leak is reported by valgrind on 1.9. |
Signed-off-by: Jeff Erbrecht <jefferbrecht@google.com>
Good to see your fix on this issue, @jefferbrecht. Look forward to seeing this one gets merged into 1.9.x. |
@edsiper @leonardo-albertovich @fujimotos @koleini I am wondering when you can help review the fix. |
Any update on this one? |
Hello, In which build can we have this patch ? Is it available in the 2.0.6 released some days ago ? Thanks |
@edsiper How come I don't see this in the release notes for 1.9.10? |
Backport of #6319 to 1.9.
Fix time zone offsets being lost on Windows when parsing time stamps.
Fixes #2941.
Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.