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

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

Open
kiran251 opened this issue Aug 7, 2019 · 1 comment

Comments

@kiran251
Copy link

kiran251 commented Aug 7, 2019

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

  • OS version: Ubuntu 16.04.6 LTS (Xenial Xerus)
  • Bare Metal or within Docker or Kubernetes or others? AWS EC2
  • Fluentd v0.12 or v0.14/v1.0: td-agent 1.4.2
  • Dependent gem versions
    fluent-plugin-cloudwatch-logs (0.7.4)
@shunta27
Copy link

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

  • OS version: 16.04.3 LTS (Xenial Xerus)
  • td-agent 1.11.1
  • fluent-plugin-cloudwatch-logs (0.10.2)

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