fluent / fluent-operator

Operate Fluent Bit and Fluentd in the Kubernetes way - Previously known as FluentBit Operator
Apache License 2.0
587 stars 250 forks source link

LUA filter inline code support #1081

Closed chrono2002 closed 8 months ago

chrono2002 commented 8 months ago

Adds support for "code:" inline block in LUA namespace-wide filter. See: https://docs.fluentbit.io/manual/pipeline/filters/lua "code | Inline LUA code instead of loading from a path via script."

None
Usage:

apiVersion: fluentbit.fluent.io/v1alpha2
kind: Filter
metadata:
  labels:
    fluentbit.fluent.io/enabled: "true"
  name: test
spec:
  match: "*"
  filters:
  - lua:
      call: converter
      protectedMode: true 
      code: |
        function converter(tag, timestamp, record)
            return 0, 0, 0
        end