kube-logging / logging-operator

Logging operator for Kubernetes
https://kube-logging.dev
Apache License 2.0
1.52k stars 326 forks source link

Forward output time_as_integer #1740

Closed davide-rossi-ce closed 2 months ago

davide-rossi-ce commented 2 months ago

This PR adds support for the time_as_integer configuration parameter to the Forward Output. It inclused the addition of a simple test case for the Forward Output.

As specified in the fluentd 0.14 release notes ( https://www.fluentd.org/blog/fluentd-v0.14.0-has-been-released ), when this parameter is set to "true", the events are forwarded formatting the event time as an epoch integer, using second resolution. If false, which is the default value, the events are sent as binary data with nanosecond resolution, which crashes old Fluentd versions.

In some occurrences, this settings can also be useful to forward events to Logstash instances, because Logstash' "fluent" codec by default is not compatible with the nanosecond resolution binary data that comes from Fluentd.