-
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
GELF output writes subsecond portion of timestamp incorrectly, losing leading zeros #3727
Comments
nokute78
added a commit
to nokute78/fluent-bit
that referenced
this issue
Aug 2, 2021
It detects fluent#3727 Signed-off-by: Takahiro Yamashita <[email protected]>
nokute78
added a commit
to nokute78/fluent-bit
that referenced
this issue
Aug 2, 2021
Signed-off-by: Takahiro Yamashita <[email protected]>
nokute78
added a commit
to nokute78/fluent-bit
that referenced
this issue
Aug 2, 2021
Signed-off-by: Takahiro Yamashita <[email protected]>
3 tasks
Thank you for pointing it. |
edsiper
pushed a commit
that referenced
this issue
Aug 2, 2021
It detects #3727 Signed-off-by: Takahiro Yamashita <[email protected]>
edsiper
pushed a commit
that referenced
this issue
Aug 2, 2021
Signed-off-by: Takahiro Yamashita <[email protected]>
gautampunhani
pushed a commit
to gautampunhani/fluent-bit
that referenced
this issue
Aug 4, 2021
It detects fluent#3727 Signed-off-by: Takahiro Yamashita <[email protected]>
gautampunhani
pushed a commit
to gautampunhani/fluent-bit
that referenced
this issue
Aug 4, 2021
Signed-off-by: Takahiro Yamashita <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Describe the bug
Given a timestamp in fluent-bit of the form e.g.
2021-07-05T12:34:56.012345678
, the GELF output will render that to a timestamp as1625488496.12
rather than1625488496.012
or1625488496.01
or similar. Basically, the leading zero in the fractional portion of the timestamp is lost.To Reproduce
Log message:
fluent-bit.conf:
Steps to reproduce:
/tmp/example.log
/fluent-bit/etc/fluent-bit.conf
, if using thefluent-bit
container)nc -u -l 12201
ornc -u -l -p 12201
(depending on platform) to listen for UDP packets and output them to the shellfluent-bit -c <path-to-config-file>
Expected behavior
nc
should receive the following:{"version":"1.1", "short_message":"example", "_stream":"stdout", "_time":"2021-07-05T12:34:56.012345678", "timestamp":1625488496.012}
Actual behavior
nc
receives the following:{"version":"1.1", "short_message":"example", "_stream":"stdout", "_time":"2021-07-05T12:34:56.012345678", "timestamp":1625488496.12}
Your Environment
fluent-bit
docker image, so,distroless
Additional context
The source of the bug is https://github.com/fluent/fluent-bit/blob/master/src/flb_pack_gelf.c#L765-L766, specifically in passing integer numbers of seconds and milliseconds to
printf
with a format string like%u.%lu
. If the number of milliseconds is 13, this will be rendered as e.g.1.13
rather than1.013
. A correct format string would be more along the lines of%u.%03lu
. A pull request will follow shortly.The text was updated successfully, but these errors were encountered: