syslog-ng config, stricter RFC5424 format for Promtail
This commit is contained in:
+13
-15
@@ -18,25 +18,23 @@ source s_local {
|
|||||||
};
|
};
|
||||||
|
|
||||||
source s_network {
|
source s_network {
|
||||||
default-network-drivers(
|
default-network-drivers();
|
||||||
# NOTE: TLS support
|
};
|
||||||
#
|
|
||||||
# the default-network-drivers() source driver opens the TLS
|
# Force every message into the standard RFC5424 format that Promtail expects.
|
||||||
# enabled ports as well, however without an actual key/cert
|
template t_promtail_rfc5424 {
|
||||||
# pair they will not operate and syslog-ng would display a
|
template("<${PRI}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} - ${MSG}\\n");
|
||||||
# warning at startup.
|
|
||||||
#
|
|
||||||
#tls(key-file("/path/to/ssl-private-key") cert-file("/path/to/ssl-cert"))
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
destination d_loki {
|
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 {
|
log {
|
||||||
source(s_local);
|
source(s_local);
|
||||||
source(s_network);
|
source(s_network);
|
||||||
destination(d_loki);
|
destination(d_loki);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user