Closed boatmisser closed 4 years ago
Never mind, I worked it out.
You need to set the message_keys
.
nooo please put a sample!!! i am on the same quest :dagger:
2021/07/27 23:10:33] [error] [config] cloudwatch_logs: unknown configuration property 'message_keys'. The following properties are allowed: region, log_group_name, log_stream_name, log_stream_prefix, log_key, extra_user_agent, log_format, role_arn, auto_create_group, log_retention_days, endpoint, sts_endpoint, metric_namespace, and metric_dimensions. [2021/07/27 23:10:33] [ help] try the command: /fluent-bit/bin/fluent-bit -o cloudwatch_logs -h
Problem
We do not want our log events to be JSON; we want the message to be the raw message! E.g. instead of
{"message": "2020-09-22 10-23-41 INFO - Hello World"}
we want2020-09-22 10-23-41 INFO - Hello World
...Steps to replicate
Expected Behavior or What you need to ask
If I replace the
@type cloudwatch_logs
match with an@type stdout
; the output is formatted correctly I.e. as normal text not JSON. We want the CloudWatch event message to be the same raw message and not wrapped in a JSON object. E.g. instead of{"message": "2020-09-22 10-23-41 INFO - Hello World"}
we want2020-09-22 10-23-41 INFO - Hello World
Is this possible? Or does the plugin only ever send JSON regardless of the fluentd config? ...
Using Fluentd and CloudWatchLogs plugin versions
Kubernetes: 1.17 Fluentd: fluent/fluentd-kubernetes-daemonset:v1.7.3-debian-cloudwatch-1.0