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

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

Support format in out_cloudwatch_logs #212

Closed wills-feng closed 3 years ago

wills-feng commented 3 years ago

Problem

The format is not recognized in out_cloudwatch_logs. Is there a common case to format output before sending to cloudwatch?

logs in cloudwatch: "message":"Plain logs" expected only keep value(single_value format): "Plain logs"

...

Steps to replicate

Provide example config and message

Expected Behavior or What you need to ask

...

Using Fluentd and CloudWatchLogs plugin versions

cosmo0920 commented 3 years ago

We didn't support arbitrary format on out_cloudwatch_logs just supported JSON encoded style. I've heard it for the first time.

cosmo0920 commented 3 years ago

fluent-plugin-cloudwatch-logs v0.12.0 can handle <format> section on its configuration:

<match **>
  @type cloudwatch_logs
  # ... Some stuff
  <format>
    @type single_value
    message_key message
  </format>
</match>