t0xa / gelfj

Graylog Extended Log Format (GELF) implementation in Java and log4j appender without any dependencies.
https://github.com/t0xa/gelfj/wiki
Other
187 stars 115 forks source link

Invalid timestamp #117

Closed pdepaepe closed 6 years ago

pdepaepe commented 7 years ago

Hello,

GELF Format Specification Version 1.1 (11/2013) expect a number as timestamp http://docs.graylog.org/en/2.2/pages/gelf.html but the library send a String:

https://github.com/t0xa/gelfj/blob/master/src/main/java/org/graylog2/GelfMessage.java#L227

This is a problem for any input respecting GELF format specification as all logs emit by the library will be drop because of invalid timestamp.

Thanks.

joschi commented 7 years ago

This came up in a bug report for Graylog 2.3.0-rc.2: https://github.com/Graylog2/graylog2-server/issues/4027

The "timestamp" field should definitely be a floating point number and not a string.

bonzi316 commented 7 years ago

+1

any ETA on this ? It is hurting my app and we are dropping a lots of messages.

Thanks

joschi commented 7 years ago

@bonzi316 Graylog doesn't drop GELF messages in which the timestamp field is a string.

See the referenced Graylog2/graylog2-server#4027 for details.

tholu commented 6 years ago

This no longer seems to be true for graylog 2.4.0 (messages are not appearing anymore).

jasonvangundy commented 6 years ago

@tholu I am seeing the same behavior. My graylog logs are filling up with warnings calling out invalid timestamps. I had read they should be processed still, per @joschi, but I do not see gelfj messages indexed in graylog at all. Looks like @todvora may have a fix. Are you thinking of PRing that back here?

tholu commented 6 years ago

@jasonvangundy This repo does not seem to be maintained anymore. You can use v1.1.16 from https://github.com/todvora/gelfj/releases via https://jitpack.io/ to fix it (already tested and in production).

jasonvangundy commented 6 years ago

Thanks @tholu ! You must be getting a different result than I am. You aren't seeing the following? https://jitpack.io/com/github/todvora/gelfj/v1.1.16/build.log

todvora commented 6 years ago

Sorry about that, @jasonvangundy - this is a failed and cached build. You can now get the v1.1.17, which builds fine: https://jitpack.io/#todvora/gelfj/v1.1.17

todvora commented 6 years ago

Here is my PR with the mentioned fix: https://github.com/t0xa/gelfj/pull/121

t0xa commented 6 years ago

@todvora Thanks for PR. Merged and released as v1.1.16. Should be available in Central shortly.

Edit: mistyped released version

todvora commented 6 years ago

Awesome, thank you @t0xa!