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

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

in_cloudwatch_logs: fix error while fetching yesterdays logstream with prefix #241

Closed navops29 closed 2 years ago

navops29 commented 2 years ago

Using in_cloudwatch with below settings:

<source>
  @type cloudwatch_logs
  region us-east-1
  aws_use_sts true
  aws_sts_role_arn <redacted>
  log_group_name /aws/lambda/prod
  use_log_group_name_prefix true
  include_metadata true
  use_todays_log_stream true
  format /(?<message>.+)/
  tag cloudwatch.input
  <storage>
   @type local
   path /var/tmp/cloudwatchstate
  </storage>
</source>

This gives below error while describing yesterday's log streams.

2021-11-16 14:05:26 +0000 [warn]: #0 fluent/log.rb:351:warn: '' prefixed log stream(s) are not found
2021-11-16 14:05:27 +0000 [warn]: #0 fluent/log.rb:351:warn: '' prefixed log stream(s) are not found
2021-11-16 14:05:27 +0000 [warn]: #0 fluent/log.rb:351:warn: '' prefixed log stream(s) are not found
2021-11-16 14:05:27 +0000 [warn]: #0 fluent/log.rb:351:warn: '' prefixed log stream(s) are not found

This PR fixes the issue by passing the log group name while fetching log streams with yesterday's prefix.

atanunq commented 2 years ago

Hey! Apologies for reviving an old PR, but are there any plans for tagging a new release with this fix? Thanks

cosmo0920 commented 2 years ago

Ah, I'd forgotten to release this patch as new version. I've released this patch as v0.14.3. Please check and use it.