fluentd-forwarder icon indicating copy to clipboard operation
fluentd-forwarder copied to clipboard

Support int64 timestamps

Open jacksontj opened this issue 6 years ago • 0 comments

The codec decoder decides what type to do based on reflection etc. which doesn't gaurantee that we'll get the type we want (since we are decoding into an empty interface).

The golang fluent-logger client (https://github.com/fluent/fluent-logger-golang) sends the timestamps as int64 (not uint64) -- which was causing errors about "Unknown type".

This patch allows the codec decoder to pick the type it wants and we'll do validation on it-- specifically if it is an int64 we coerce it to uint64 -- logging an error if the value given to us was negative (since we can't convert, and a negative timestamp is just generally considered wrong)

jacksontj avatar Jul 28 '17 16:07 jacksontj