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

helm : allow to define custom parsers to use with fluentbit.io/parser annotation #1430

Merged
merged 1 commit into from
Jan 10, 2020
Merged
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 production/helm/fluent-bit/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: "v1"
name: fluent-bit
version: 0.0.2
version: 0.0.3
appVersion: v0.0.1
kubeVersion: "^1.10.0-0"
description: "Uses fluent-bit Loki go plugin for gathering logs and sending them to Loki"
Expand Down
2 changes: 2 additions & 0 deletions production/helm/fluent-bit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ For more details, read the [Fluent Bit documentation](../../../cmd/fluent-bit/RE
| `config.port` | the Fluent Bit port to listen. (This is mainly used to serve metrics) | `2020` |
| `config.loglevel` | the Fluent Bit log level (debug,info,warn,error). | `warn` |
| `config.lineFormat` | The line format to use to send a record (json/key_value) | `json` |
| `config.k8sLoggingParser`| Allow Kubernetes Pods to suggest a pre-defined Parser. See [Official Fluent Bit documentation](https://docs.fluentbit.io/manual/filter/kubernetes#kubernetes-annotations). | `Off` |
| `config.removeKeys` | The list of key to remove from each record | `[removeKeys,stream]` |
| `config.labels` | A set of labels to send for every log | `'{job="fluent-bit"}'` |
| `config.labelMap` | Mapping of labels from a record. See [Fluent Bit documentation](../../../cmd/fluent-bit/README.md) | |
| `config.parsers` | Definition of extras fluent bit parsers. See [Official Fluent Bit documentation](https://docs.fluentbit.io/manual/filter/parser). The format is a sequence of mappings where each key is the same as the one in the [PARSER] section of parsers.conf file | `[]` |
| `affinity` | [affinity][affinity] settings for pod assignment | `{}` |
| `annotations` | Annotations to add to Kubernetes resources. | `{}` |
| `deploymentStrategy` | The deployment strategy to use with the daemonset | `RollingUpdate` |
Expand Down
8 changes: 8 additions & 0 deletions production/helm/fluent-bit/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ data:
Match kube.*
Kube_URL https://kubernetes.default.svc:443
Merge_Log On
K8S-Logging.Parser {{ .Values.config.k8sLoggingParser }}
[Output]
Name loki
Match *
Expand All @@ -47,6 +48,13 @@ data:
Format json
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%L
{{- range $parser:= .Values.config.parsers }}
[PARSER]
{{- range $key,$value := $parser }}
{{ $key }} = {{ $value }}
{{- end }}
{{- end }}

labelmap.json: |-
{{- .Values.config.labelMap | toPrettyJson | nindent 4}}

7 changes: 7 additions & 0 deletions production/helm/fluent-bit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ config:
port: 2020
loglevel: warn
lineFormat: json
k8sLoggingParser: "Off"
olivierboudet marked this conversation as resolved.
Show resolved Hide resolved
removeKeys:
- kubernetes
- stream
Expand All @@ -24,6 +25,12 @@ config:
container_name: container
pod_name: instance
stream: stream
# parsers: # Allow to define custom parsers. The key here is the same as the one in the [PARSER] section of parsers.conf file.
# - Name: json
# Format: json
# Time_Key: time
# Time_Format: "%d/%b/%Y:%H:%M:%S %z"


affinity: {}

Expand Down