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

How to Replace Authorization Header with Environment Variable? #25

Open
RuiZhang2 opened this issue Dec 7, 2021 · 2 comments
Open

How to Replace Authorization Header with Environment Variable? #25

RuiZhang2 opened this issue Dec 7, 2021 · 2 comments

Comments

@RuiZhang2
Copy link

Typically, fluentd supports environment variable replacement. However, it does not work for vmware-log-intelligence plugin.
Just wondering if you have any function support which is similar to what is shown below? :

 <headers>
    ...
    Authorization Bearer #{ENV['API-Token']}"
    ...
  </headers>
@4n3w
Copy link

4n3w commented Jan 17, 2024

I just ran into this same issue, where my endpoint_url populates fine from an environment variable, but the token does not.

<match tmc_audit.**>
  @type vmware_log_intelligence
  endpoint_url "#{ENV['ARIA_LOG_URL']}"
  verify_ssl true
  http_compress false
  <headers>
    Content-Type application/json
    Authorization Bearer "#{ENV['ARIA_LOG_TOKEN']}"
    structure simple
  </headers>

@4n3w
Copy link

4n3w commented Jan 17, 2024

Actually, figured it out. It looks like it's a quirk of how the headers get parsed, this works for me:

    Authorization "Bearer #{ENV['ARIA_LOG_TOKEN']}"

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

No branches or pull requests

2 participants