From 02cd55c302ad2b7bfe9b7d8304e3966550b477eb Mon Sep 17 00:00:00 2001 From: bschmitt Date: Wed, 17 Apr 2024 13:46:21 -0500 Subject: [PATCH 1/8] add addtnl log parser flexibility --- charts/newrelic-logging/templates/daemonset.yaml | 2 ++ charts/newrelic-logging/values.yaml | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/charts/newrelic-logging/templates/daemonset.yaml b/charts/newrelic-logging/templates/daemonset.yaml index 4bc7c73dd..454c416fe 100644 --- a/charts/newrelic-logging/templates/daemonset.yaml +++ b/charts/newrelic-logging/templates/daemonset.yaml @@ -90,6 +90,8 @@ spec: - name: LOG_PARSER {{- if .Values.fluentBit.criEnabled }} value: "cri,docker" + {{- else if .Values.fluentBit.logParsers }} + value: {{ .Values.fluentBit.logParsers | quote }} {{- else }} value: "docker,cri" {{- end }} diff --git a/charts/newrelic-logging/values.yaml b/charts/newrelic-logging/values.yaml index c8f19bdf7..bc4ae343e 100644 --- a/charts/newrelic-logging/values.yaml +++ b/charts/newrelic-logging/values.yaml @@ -31,7 +31,14 @@ fluentBit: windowsPath: "C:\\var\\log\\containers\\*.log" db: "/var/log/flb_kube.db" windowsDb: "C:\\var\\log\\flb_kube.db" - criEnabled: true + + ## Deprecated: please use logParsers paramater instead + # criEnabled: true + + ## Append to default log parsers using comma separated values. + ## You must also update the parsers.conf stanza futher down in this file. + logParsers: "cri, docker" + k8sBufferSize: "32k" k8sLoggingExclude: "Off" retryLimit: 5 From 3de871fc83eb8034006a23cbafd1a3905af3d973 Mon Sep 17 00:00:00 2001 From: bschmitt Date: Wed, 17 Apr 2024 13:53:04 -0500 Subject: [PATCH 2/8] fix typo --- charts/newrelic-logging/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/newrelic-logging/values.yaml b/charts/newrelic-logging/values.yaml index bc4ae343e..857c911a1 100644 --- a/charts/newrelic-logging/values.yaml +++ b/charts/newrelic-logging/values.yaml @@ -32,7 +32,7 @@ fluentBit: db: "/var/log/flb_kube.db" windowsDb: "C:\\var\\log\\flb_kube.db" - ## Deprecated: please use logParsers paramater instead + ## Deprecated: please use logParsers parameter instead # criEnabled: true ## Append to default log parsers using comma separated values. From c2c53e0a5c1106bbb25a9a40818a26ba3e1e2ec3 Mon Sep 17 00:00:00 2001 From: bschmitt Date: Thu, 18 Apr 2024 11:22:09 -0500 Subject: [PATCH 3/8] fix indentation issues --- charts/newrelic-logging/values.yaml | 37 +++++++++++++++-------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/charts/newrelic-logging/values.yaml b/charts/newrelic-logging/values.yaml index 857c911a1..37bd9dbb1 100644 --- a/charts/newrelic-logging/values.yaml +++ b/charts/newrelic-logging/values.yaml @@ -35,8 +35,8 @@ fluentBit: ## Deprecated: please use logParsers parameter instead # criEnabled: true - ## Append to default log parsers using comma separated values. - ## You must also update the parsers.conf stanza futher down in this file. + ## Append to the default log parsers using comma separated values. + ## If supplying a custom parser, must also update the parsers stanza futher down in this file. logParsers: "cri, docker" k8sBufferSize: "32k" @@ -112,10 +112,10 @@ fluentBit: Skip_Long_Lines On Refresh_Interval 10 -# extraInputs: | -# [INPUT] -# Name dummy -# Tag dummy.log + # extraInputs: | + # [INPUT] + # Name dummy + # Tag dummy.log filters: | [FILTER] @@ -183,18 +183,19 @@ fluentBit: sendMetrics ${SEND_OUTPUT_PLUGIN_METRICS} Retry_Limit ${RETRY_LIMIT} -# extraOutputs: | -# [OUTPUT] -# Name null -# Match * - -# parsers: | -# [PARSER] -# Name my_custom_parser -# Format json -# Time_Key time -# Time_Format %Y-%m-%dT%H:%M:%S.%L -# Time_Keep On + # extraOutputs: | + # [OUTPUT] + # Name null + # Match * + + # parsers: | + # [PARSER] + # Name my_custom_parser + # Format json + # Time_Key time + # Time_Format %Y-%m-%dT%H:%M:%S.%L + # Time_Keep On + metricInstrumentation: | [INPUT] name prometheus_scrape From 567d70154e5ba400cdc5a30cb8a20bf8b774cd87 Mon Sep 17 00:00:00 2001 From: bschmitt Date: Thu, 18 Apr 2024 11:25:35 -0500 Subject: [PATCH 4/8] bump chart version --- charts/newrelic-logging/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/newrelic-logging/Chart.yaml b/charts/newrelic-logging/Chart.yaml index 28813dc63..3e2630686 100644 --- a/charts/newrelic-logging/Chart.yaml +++ b/charts/newrelic-logging/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: A Helm chart to deploy New Relic Kubernetes Logging as a DaemonSet, supporting both Linux and Windows nodes and containers name: newrelic-logging -version: 1.21.2 +version: 1.21.3 appVersion: 1.19.2 home: https://github.com/newrelic/kubernetes-logging icon: https://newrelic.com/assets/newrelic/source/NewRelic-logo-square.svg From 3dfbf1239d772c3fd34ffc2afb4f27ccc29fe7de Mon Sep 17 00:00:00 2001 From: bschmitt Date: Thu, 18 Apr 2024 11:34:26 -0500 Subject: [PATCH 5/8] update README --- charts/newrelic-logging/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/newrelic-logging/README.md b/charts/newrelic-logging/README.md index deb45426b..885666f81 100644 --- a/charts/newrelic-logging/README.md +++ b/charts/newrelic-logging/README.md @@ -167,7 +167,8 @@ See [values.yaml](values.yaml) for the default values | `fluentBit.retryLimit` | Amount of times to retry sending a given batch of logs to New Relic. This prevents data loss if there is a temporary network disruption, if a request to the Logs API is lost or when receiving a recoverable HTTP response. Set it to "False" for unlimited retries. | 5 | | `fluentBit.sendMetrics` | Enable the collection of Fluent Bit internal metrics in Prometheus format as well as newrelic-fluent-bit-output internal plugin metrics. | `false` | | `dnsConfig` | [DNS configuration](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config) that will be added to the pods. Can be configured also with `global.dnsConfig`. | `{}` | -| `fluentBit.criEnabled` | We assume that `kubelet`directly communicates with the container engine using the [CRI](https://kubernetes.io/docs/concepts/overview/components/#container-runtime) specification. Set this to `false` if your K8s installation uses [dockershim](https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/) instead, in order to get the logs properly parsed. | `true` | +| `fluentBit.criEnabled` [deprecated] | We assume that `kubelet`directly communicates with the container engine using the [CRI](https://kubernetes.io/docs/concepts/overview/components/#container-runtime) specification. Set this to `false` if your K8s installation uses [dockershim](https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/) instead, in order to get the logs properly parsed. | `true` | +| `fluentBit.logParsers` | Contains the default `cri, docker` log parsers and enables users to add additional custom parsers if required | `cri, docker` | ### Fluent Bit persistence modes From 4f8a1b35be5d179c04a768e7efdb457abc8e798c Mon Sep 17 00:00:00 2001 From: bschmitt Date: Thu, 18 Apr 2024 11:35:38 -0500 Subject: [PATCH 6/8] fix typo --- charts/newrelic-logging/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/newrelic-logging/values.yaml b/charts/newrelic-logging/values.yaml index 37bd9dbb1..c599f9f1e 100644 --- a/charts/newrelic-logging/values.yaml +++ b/charts/newrelic-logging/values.yaml @@ -36,7 +36,7 @@ fluentBit: # criEnabled: true ## Append to the default log parsers using comma separated values. - ## If supplying a custom parser, must also update the parsers stanza futher down in this file. + ## If supplying a custom parser, must also update the parsers stanza further down in this file. logParsers: "cri, docker" k8sBufferSize: "32k" From 7a0a203d514e0560f058df89f07f18f67ae145d9 Mon Sep 17 00:00:00 2001 From: bschmitt Date: Thu, 18 Apr 2024 11:39:57 -0500 Subject: [PATCH 7/8] fix trailing spaces --- charts/newrelic-logging/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/newrelic-logging/values.yaml b/charts/newrelic-logging/values.yaml index c599f9f1e..1d888a41d 100644 --- a/charts/newrelic-logging/values.yaml +++ b/charts/newrelic-logging/values.yaml @@ -35,7 +35,7 @@ fluentBit: ## Deprecated: please use logParsers parameter instead # criEnabled: true - ## Append to the default log parsers using comma separated values. + ## Append to the default log parsers using comma separated values. ## If supplying a custom parser, must also update the parsers stanza further down in this file. logParsers: "cri, docker" From 1d8353891c281111b198ba6dc2c9d2f3965cf314 Mon Sep 17 00:00:00 2001 From: bschmitt Date: Thu, 18 Apr 2024 11:46:13 -0500 Subject: [PATCH 8/8] udpate windows template --- charts/newrelic-logging/templates/daemonset-windows.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/newrelic-logging/templates/daemonset-windows.yaml b/charts/newrelic-logging/templates/daemonset-windows.yaml index 754c1f79d..69f836d8f 100644 --- a/charts/newrelic-logging/templates/daemonset-windows.yaml +++ b/charts/newrelic-logging/templates/daemonset-windows.yaml @@ -78,8 +78,10 @@ spec: - name: LOG_LEVEL value: {{ $.Values.fluentBit.logLevel | quote }} - name: LOG_PARSER - {{- if $.Values.fluentBit.criEnabled }} + {{- if .Values.fluentBit.criEnabled }} value: "cri,docker" + {{- else if .Values.fluentBit.logParsers }} + value: {{ .Values.fluentBit.logParsers | quote }} {{- else }} value: "docker,cri" {{- end }}