From 9c382aeed540b922edab2c03e7c51888f84d1716 Mon Sep 17 00:00:00 2001 From: Balazs Scheidler Date: Sat, 10 Feb 2024 12:59:02 +0100 Subject: [PATCH] kubernetes(): truncate the terminating NL character from the message Signed-off-by: Balazs Scheidler --- .../syslogng/modules/kubernetes/scl/kubernetes.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/python-modules/syslogng/modules/kubernetes/scl/kubernetes.conf b/modules/python-modules/syslogng/modules/kubernetes/scl/kubernetes.conf index 4e81f7efaa0..8d53f93903d 100644 --- a/modules/python-modules/syslogng/modules/kubernetes/scl/kubernetes.conf +++ b/modules/python-modules/syslogng/modules/kubernetes/scl/kubernetes.conf @@ -105,7 +105,8 @@ block parser kubernetes-json-file-parser(prefix('.k8s.') cluster-name('k8s') key json-parser(internal(yes) prefix(`prefix`)); channel { rewrite { - set("${`prefix`log}" value(MESSAGE) internal(yes)); + # chomp the final newline + set("$(substr ${`prefix`log} 0 -1)" value(MESSAGE) internal(yes)); }; }; date-parser(internal(yes) format("%FT%H:%M:%S.%f%Z") template("${`prefix`time}"));