diff --git a/syslog-ng/syslog-ng.conf b/syslog-ng/syslog-ng.conf index 113d112..1c4a018 100755 --- a/syslog-ng/syslog-ng.conf +++ b/syslog-ng/syslog-ng.conf @@ -18,25 +18,23 @@ source s_local { }; source s_network { - default-network-drivers( - # NOTE: TLS support - # - # the default-network-drivers() source driver opens the TLS - # enabled ports as well, however without an actual key/cert - # pair they will not operate and syslog-ng would display a - # warning at startup. - # - #tls(key-file("/path/to/ssl-private-key") cert-file("/path/to/ssl-cert")) - ); + default-network-drivers(); +}; + +# Force every message into the standard RFC5424 format that Promtail expects. +template t_promtail_rfc5424 { + template("<${PRI}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} - ${MSG}\\n"); }; destination d_loki { - syslog("promtail" transport("tcp") port("1514")); + syslog("promtail" transport("tcp") port("1514") + # APPLY THE TEMPLATE TO THE DESTINATION + template(t_promtail_rfc5424) + ); }; log { - source(s_local); - source(s_network); - destination(d_loki); -}; - + source(s_local); + source(s_network); + destination(d_loki); +}; \ No newline at end of file