Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[newrelic-logging] add logParsers parameter, fix indentation #1338

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/newrelic-logging/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion charts/newrelic-logging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion charts/newrelic-logging/templates/daemonset-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions charts/newrelic-logging/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
42 changes: 25 additions & 17 deletions charts/newrelic-logging/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 parameter instead
# criEnabled: true

## 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"

k8sBufferSize: "32k"
k8sLoggingExclude: "Off"
retryLimit: 5
Expand Down Expand Up @@ -105,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]
Expand Down Expand Up @@ -176,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
Expand Down
Loading