fluent-plugins-nursery / fluent-plugin-cloudwatch-logs

CloudWatch Logs Plugin for Fluentd
MIT License
201 stars 141 forks source link

Error setting the region in td-agent.conf using the environment variables #160

Open kiran251 opened 5 years ago

kiran251 commented 5 years ago

Problem

Hi, I am trying to set the region parameter in the td-agent.conf file using env variables. Here is the how the agent conf file looks like:

<match api.error>
  type cloudwatch_logs
  log_group_name test-group
  log_stream_name test-stream
  region "#{ENV['AWS_REGION']}"
</match>

Also, I added an entry AWS_REGION=us-east-1 in the /etc/default/td-agent file. When I start the td-agent service, I see an error in the td-agent log file as shown below:

"unexpected error error_class=Aws::Errors::MissingRegionError error="missing region; use :region option or export region name to ENV['AWS_REGION']"

Steps to replicate

Use the sample config above in td-agent.conf and set the AWS_REGION env variable in the /etc/default/td-agent file. Start the td-agent service and see the error in the log file

Expected Behavior or What you need to ask

I need to set the region in the confg file using env variables. I can get the region from the instance metadata but when passing it to the conf file, it throws an error. Any help here on how to fix this issue?? ...

Using Fluentd and CloudWatchLogs plugin versions

shunta27 commented 4 years ago

Hi, I am facing exactly the same problem Is there a solution?