Roguelazer/rust-syslog-rfc5424

Fractional time unit

Closed this issue · 1 comments

I've been figuring out why we are seeing some unexpected fractional times when parsing syslog lines using this crate. The crate assumes the fraction is a nanosecond value. But according to the RFC the fraction is a microsecond or millisecond value, and that nanosecond values are explicitly not supported. How to interpret is determined by the length of the value. See: https://www.rfc-editor.org/rfc/rfc5424.html#section-6.2.3.1

Is there a reason why this crate assumes nanoseconds? If not I'll make a patch so that we follow the RFC.

Ah doing some further testing and this does seem to behave in the correct way. Since nanos are a division feeding it milliseconds or microseconds will also work.