From 792b7cd6c1bfbbbfc12906ab356fe951e36c16cd Mon Sep 17 00:00:00 2001 From: Kristof Gyuracz Date: Thu, 23 Nov 2023 13:56:36 +0100 Subject: [PATCH 1/2] feat(k8s-source): add configurable fields for json paramaters --- charts/axosyslog-collector/README.md | 4 ++++ charts/axosyslog-collector/templates/config.yaml | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/charts/axosyslog-collector/README.md b/charts/axosyslog-collector/README.md index afa5a68..56d2987 100644 --- a/charts/axosyslog-collector/README.md +++ b/charts/axosyslog-collector/README.md @@ -49,3 +49,7 @@ The following table lists the configurable parameters of the AxoSyslog Collector | tolerations | Tolerations for pod assignment | [] | | affinity | Pod affinity | {} | | updateStrategy | Update strategy for the DaemonSet | RollingUpdate | +| kubernetes.enabled | Enable kubernetes log collection | true | +| kubernetes.prefix | Set JSON prefix for logs collected from the k8s cluster | "" | +| kubernetes.keyDelimiter | Set JSON key delimiter for logs collected from the k8s cluster | "" | + diff --git a/charts/axosyslog-collector/templates/config.yaml b/charts/axosyslog-collector/templates/config.yaml index 6f045b4..3d7f144 100644 --- a/charts/axosyslog-collector/templates/config.yaml +++ b/charts/axosyslog-collector/templates/config.yaml @@ -20,7 +20,14 @@ data: log { {{- if .Values.config.sources.kubernetes.enabled }} - source { kubernetes(); }; + source { kubernetes( + {{- if .Values.config.sources.kubernetes.prefix }} + prefix("{{ .Values.config.sources.kubernetes.prefix }}") + {{- end }} + {{- if .Values.config.sources.kubernetes.keyDelimiter }} + key-delimiter("{{ .Values.config.sources.kubernetes.keyDelimiter }}") + {{- end }} + ); }; {{- end }} {{- range .Values.config.sources.opentelemetry }} source { From 45f2be0f7ff08741493beec0cd6584e5c47136d2 Mon Sep 17 00:00:00 2001 From: Kristof Gyuracz Date: Thu, 23 Nov 2023 14:43:05 +0100 Subject: [PATCH 2/2] fixes for review --- charts/axosyslog-collector/templates/config.yaml | 4 ++-- charts/axosyslog-collector/values.yaml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/charts/axosyslog-collector/templates/config.yaml b/charts/axosyslog-collector/templates/config.yaml index 3d7f144..7f1c762 100644 --- a/charts/axosyslog-collector/templates/config.yaml +++ b/charts/axosyslog-collector/templates/config.yaml @@ -22,10 +22,10 @@ data: {{- if .Values.config.sources.kubernetes.enabled }} source { kubernetes( {{- if .Values.config.sources.kubernetes.prefix }} - prefix("{{ .Values.config.sources.kubernetes.prefix }}") + prefix({{ .Values.config.sources.kubernetes.prefix | quote }}) {{- end }} {{- if .Values.config.sources.kubernetes.keyDelimiter }} - key-delimiter("{{ .Values.config.sources.kubernetes.keyDelimiter }}") + key-delimiter({{ .Values.config.sources.kubernetes.keyDelimiter | quote }}) {{- end }} ); }; {{- end }} diff --git a/charts/axosyslog-collector/values.yaml b/charts/axosyslog-collector/values.yaml index d3f3917..ebd2a37 100644 --- a/charts/axosyslog-collector/values.yaml +++ b/charts/axosyslog-collector/values.yaml @@ -45,6 +45,9 @@ config: sources: kubernetes: enabled: true +# E.g.: +# prefix: "k8s~" +# keyDelimiter: "~" opentelemetry: [] # E.g.: # - port: 4317