File 0008-default-rules-use-container_name_and_id-include-rule.patch of Package rsyslog.12861
From 32e3332cd37f5ba167007c5d27ce1a57f7b6fbdc Mon Sep 17 00:00:00 2001
From: Rich Megginson <rmeggins@redhat.com>
Date: Mon, 2 Jul 2018 08:00:11 -0600
Subject: [PATCH] default rules use container_name_and_id; include rulebase
files in dist
---
contrib/mmkubernetes/Makefile.am | 2 ++
contrib/mmkubernetes/mmkubernetes.c | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/contrib/mmkubernetes/Makefile.am b/contrib/mmkubernetes/Makefile.am
index 3dcc235a6..88dca48ec 100644
--- a/contrib/mmkubernetes/Makefile.am
+++ b/contrib/mmkubernetes/Makefile.am
@@ -4,3 +4,5 @@ mmkubernetes_la_SOURCES = mmkubernetes.c
mmkubernetes_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(CURL_CFLAGS) $(LIBLOGNORM_CFLAGS)
mmkubernetes_la_LDFLAGS = -module -avoid-version
mmkubernetes_la_LIBADD = $(CURL_LIBS) $(LIBLOGNORM_LIBS)
+
+EXTRA_DIST = k8s_filename.rulebase k8s_container_name.rulebase
diff --git a/contrib/mmkubernetes/mmkubernetes.c b/contrib/mmkubernetes/mmkubernetes.c
index 1892cc10c..e2c83e8f8 100644
--- a/contrib/mmkubernetes/mmkubernetes.c
+++ b/contrib/mmkubernetes/mmkubernetes.c
@@ -77,9 +77,9 @@ DEFobjCurrIf(regexp)
*/
#define DFLT_FILENAME_LNRULES "rule=:/var/log/containers/%pod_name:char-to:.%."\
"%container_hash:char-to:_%_"\
- "%namespace_name:char-to:_%_%container_name:char-to:-%-%container_id:char-to:.%.log\n"\
+ "%namespace_name:char-to:_%_%container_name_and_id:char-to:.%.log\n"\
"rule=:/var/log/containers/%pod_name:char-to:_%_"\
- "%namespace_name:char-to:_%_%container_name:char-to:-%-%container_id:char-to:.%.log"
+ "%namespace_name:char-to:_%_%container_name_and_id:char-to:.%.log"
#define DFLT_FILENAME_RULEBASE "/etc/rsyslog.d/k8s_filename.rulebase"
/* original from fluentd plugin:
* '^(?<name_prefix>[^_]+)_(?<container_name>[^\._]+)\
--
2.16.4