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

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

define logstream_name with a dynamic value from record #244

Closed imedaouidene closed 2 years ago

imedaouidene commented 2 years ago

Problem

I'm trying to configure fluentd so that it creats a new logstream for each namespace. log_stream_name does not parse the value of the variable ${record['kubernetes‘]['namespace_name']}.

The logstream is created with this exact name : ${record['kubernetes‘]['namespace_name']}....

Steps to replicate

  @type forward
  port 24224

<match kubernetes.**> @type cloudwatch_logs log_group_name my-log-group-sample log_stream_name ${record['kubernetes‘]['namespace_name']} auto_create_stream true

Expected Behavior or What you need to ask

name of kubernetes namespace ...

wilkinho commented 4 months ago

@imedaouidene I met the same problem, may I know how did you fix it? Thank you very much.

wilkinho commented 4 months ago

using log_stream_name_key fixed my issue.