Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/fluent-bit] feature - add support for lua filter #15776

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 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 stable/fluent-bit/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: fluent-bit
version: 2.4.3
version: 2.4.5
daniel-ciaglia marked this conversation as resolved.
Show resolved Hide resolved
appVersion: 1.2.1
description: Fast and Lightweight Log/Data Forwarder for Linux, BSD and OSX
keywords:
Expand Down
4 changes: 3 additions & 1 deletion stable/fluent-bit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The following table lists the configurable parameters of the Fluent-Bit chart an
| `backend.splunk.tls_debug` | Set TLS debug verbosity level. It accept the following values: 0-4 | `1` |
| `backend.splunk.message_key` | Tag applied to all incoming logs | `kubernetes` |
| **Parsers** |
| `parsers.enabled` | Enable custom parsers | `false` |
| `parsers.enabled` | Enable custom parsers (needs to be set for all parsers) | `false` |
| `parsers.regex` | List of regex parsers | `NULL` |
| `parsers.json` | List of json parsers | `NULL` |
| `parsers.logfmt` | List of logfmt parsers | `NULL` |
Expand All @@ -99,6 +99,8 @@ The following table lists the configurable parameters of the Fluent-Bit chart an
| `filter.kubeTagPrefix` | Optional tag prefix used by Tail | `kube.var.log.containers.` |
| `filter.mergeJSONLog` | If the log field content is a JSON string map, append the map fields as part of the log structure | `true` |
| `filter.mergeLogKey` | If set, append the processed log keys under a new root key specified by this variable. | `nil` |
| `filter.lua.enabled` | Enable the use of [lua](https://docs.fluentbit.io/manual/filter/lua) filters | `false` |
| `filter.lua.raw` | Provide your Lua file; the file is mounted as `extra.lua` | `` | |
| `image.fluent_bit.repository` | Image | `fluent/fluent-bit` |
| `image.fluent_bit.tag` | Image tag | `1.2.1` |
| `image.pullPolicy` | Image pull policy | `Always` |
Expand Down
4 changes: 3 additions & 1 deletion stable/fluent-bit/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ data:
Flush {{ .Values.service.flush }}
Daemon Off
Log_Level {{ .Values.service.logLevel }}
Parsers_File parsers.conf
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the ramification of this being removed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the PR #15775 for details on that.

{{- if .Values.parsers.enabled }}
Parsers_File parsers_custom.conf
{{- end }}
Expand Down Expand Up @@ -212,4 +211,7 @@ data:
{{ end }}
{{- end }}

extra.lua: |-
{{ .Values.filter.lua.raw | indent 4 }}

{{- end -}}
6 changes: 5 additions & 1 deletion stable/fluent-bit/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ spec:
- name: config
mountPath: /fluent-bit/etc/fluent-bit-output.conf
subPath: fluent-bit-output.conf

{{- if .Values.filter.lua.enabled }}
- name: config
mountPath: /fluent-bit/etc/extra.lua
subPath: extra.lua
{{- end }}
{{- if .Values.parsers.enabled }}
- name: config
mountPath: /fluent-bit/etc/parsers_custom.conf
Expand Down
17 changes: 17 additions & 0 deletions stable/fluent-bit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,23 @@ filter:
# fluentbit.io/exclude: true. If present, discard logs from that pod.
enableExclude: true

# if true, enable support for Lua filters in final `extra.lua` file
# see documentation at https://docs.fluentbit.io/manual/filter/lua
lua:
enabled: false
raw: |-
## example callback
# function cb_print(tag, timestamp, record)
# return code, timestamp, record
# end
## Usage:
# [FILTER]
# Name lua
# Match *
# script extra.lua
# call cb_print


rbac:
# Specifies whether RBAC resources should be created
create: true
Expand Down