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

Allow accessing yaml configuration .env.xxx from lua module #9585

Closed
ecerulm opened this issue Nov 12, 2024 · 1 comment · Fixed by #9617
Closed

Allow accessing yaml configuration .env.xxx from lua module #9585

ecerulm opened this issue Nov 12, 2024 · 1 comment · Fixed by #9617

Comments

@ecerulm
Copy link

ecerulm commented Nov 12, 2024

Is your feature request related to a problem? Please describe.

While using fluentbit yaml configuration you can use

env:
  myvar1: myvalue1

but those values cannot be accessed via lua module today, the following code won't work

          - name: lua
            call: modify
            code: |
              function modify(tag, timestamp, record)
               new_record = {}
               new_record.xxxx = env.myvar1
               return  1, timestamp, new_record
              end

Describe the solution you'd like

I would like a global variable env available while evaluating the lua function giving access to the things defined in the fluent configuration yaml at .env

Describe alternatives you've considered

  • hard coding the values in the lua code

Additional context

@edsiper
Copy link
Member

edsiper commented Nov 19, 2024

tests are welcome: #9617

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 a pull request may close this issue.

2 participants