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

Render ConfigMap only if key is not empty string #1299

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

dex4er
Copy link
Contributor

@dex4er dex4er commented Aug 13, 2024

What this PR does / why we need it:

It should allow to use inline code for Lua scripts

Which issue(s) this PR fixes:

Fixes #1287

Does this PR introduced a user-facing change?

No

@dex4er
Copy link
Contributor Author

dex4er commented Aug 13, 2024

Tested with image: public.ecr.aws/dex4er/fluent-operator:pr-1298-1299

filter:

apiVersion: fluentbit.fluent.io/v1alpha2
kind: ClusterFilter
metadata:
  name: append-tag
  labels:
    fluentbit.fluent.io/enabled: "true"
    fluentbit.fluent.io/mode: fluentbit-only
spec:
  match: "*"
  filters:
    - lua:
        call: append_tag
        code: |
          function append_tag(tag, timestamp, record)
            new_record = record
            new_record["meta_type"] = tag
            return 2, timestamp, new_record
          end

output:

[Filter]
    Name    lua
    Match    *
    code    function append_tag(tag, timestamp, record) new_record = record; new_record["meta_type"] = tag; return 2, timestamp, new_record; end 
    call    append_tag

@benjaminhuo benjaminhuo merged commit b117639 into fluent:master Aug 14, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fluent-bit LUA "inline code" feature does not work
2 participants