Fluentd: Environment Variable is not working in the path of in_tail plugin

Created on 6 Nov 2019  路  2Comments  路  Source: fluent/fluentd

<source>
  @id containers.log
  @type tail
  @label @SPLUNK
  tag tail.containers.*
  path "/var/log/containers/*\"#{ENV['MY_POD_NAME']}\"*.log"
  pos_file /tmp/splunk-fluentd-containers.log.pos
  path_key source
  read_from_head true
  <parse>
    @type json
    time_key time
    time_type string
    time_format %Y-%m-%dT%H:%M:%S.%NZ
    localtime false
  </parse>
</source>

Environment variable in the path is not working.
Also, is there a way to see what path it's constructing? I enabled debug but don't see the path it is evaluating.
And no errors in the logs.

Most helpful comment

Never mind I tried without the \" and it works

All 2 comments

Never mind I tried without the \" and it works

Never mind I tried without the " and it works

I tried without " in helm chart and know it looks
path /var/log/containers/#{ENV['GREP_KEY']}.log ====> path "/var/log/containers/#{ENV[\'GREP_KEY\']}.log"

Was this page helpful?
0 / 5 - 0 ratings