Skip to content

Commit 33f9583

Browse files
committed
debugging: faq: migrate to or from go to c cloudwatch
Signed-off-by: Wesley Pettit <[email protected]>
1 parent 9a501af commit 33f9583

File tree

1 file changed

+70
-1
lines changed

1 file changed

+70
-1
lines changed

troubleshooting/debugging.md

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@
6060
- [Run Fluent Bit unit tests in a docker container](#run-fluent-bit-unit-tests-in-a-docker-container)
6161
- [Tutorial: Replicate an ECS FireLens Task Setup Locally](#tutorial-replicate-an-ecs-firelens-task-setup-locally)
6262
- [FireLens Customer Case Local Repro Template]()
63-
- [FAQ]
63+
- [FAQ](#faq)
6464
- [AWS Go Plugins vs AWS Core C Plugins](#aws-go-plugins-vs-aws-core-c-plugins)
65+
- [Migrating to or from cloudwatch_logs C plugin to or from cloudwatch Go Plugin](#migrating-to-or-from-cloudwatch_logs-c-plugin-to-or-from-cloudwatch-go-plugin)
6566
- [FireLens Tag and Match Pattern and generated config](#firelens-tag-and-match-pattern-and-generated-config)
6667
- [What to do when Fluent Bit memory usage is high](#what-to-do-when-fluent-bit-memory-usage-is-high)
6768
- [I reported an issue, how long will it take to get fixed?](#i-reported-an-issue-how-long-will-it-take-to-get-fixed)
@@ -1050,6 +1051,74 @@ However, these plugins were not as performant as the core Fluent Bit C plugins f
10501051

10511052
AWS debuted these plugins at KubeCon North America 2020; some [discussion of the improvement in performance can be found in our session](https://youtu.be/F73MgV_c2MM).
10521053

1054+
#### Migrating to or from cloudwatch_logs C plugin to or from cloudwatch Go Plugin
1055+
1056+
The following options are only supported with `Name` `cloudwatch_logs` and must be *removed* if you switch to `Name` `cloudwatch`.
1057+
1058+
* `metric_namespace`
1059+
* `metric_dimensions`
1060+
* `auto_retry_requests`
1061+
* `workers`
1062+
* The networking settings noted here: https://docs.fluentbit.io/manual/administration/networking
1063+
* `net.connect_timeout`
1064+
* `net.connect_timeout_log_error`
1065+
* `net.dns.mode`
1066+
* `net.dns.prefer_ipv4`
1067+
* `net.dns.resolver`
1068+
* `net.keepalive`
1069+
* `net.keepalive_idle_timeout`
1070+
* `net.keepalive_max_recycle`
1071+
* `net.source_address`
1072+
* If you use log group or stream name templating, each plugin has some support for this but the features and config option names are entirely different.
1073+
* https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit#templating-log-group-and-stream-names
1074+
* https://docs.fluentbit.io/manual/pipeline/outputs/cloudwatch#log-stream-and-group-name-templating-using-record_accessor-syntax
1075+
* With `cloudwatch` you can put `$()` template variables in the `log_group_name` and `log_stream_name` options. You can then use `default_log_group_name` and `default_log_stream_name` as fallback names if templating fails.
1076+
* Only `cloudwatch` supports direct templating of ECS metadata when you run in ECS: `$(ecs_task_id)`, `$(ecs_cluster)`or `$(ecs_task_arn)`. With `cloudwatch_logs` you can only inject values from the log JSONs. If you want to use ECS Metadata in your config with `cloudwatch_logs` please see: https://github.com/aws-samples/amazon-ecs-firelens-examples/tree/mainline/examples/fluent-bit/init-metadata
1077+
* With `cloudwatch_logs` templates go in the `log_group_template` or `log_stream_template` and use a `$var` syntax (see [documentation](https://docs.fluentbit.io/manual/pipeline/outputs/cloudwatch#log-stream-and-group-name-templating-using-record_accessor-syntax)). Fallback names if templating fails go in the `log_group_name`, `log_stream_name`, or` log_stream_prefix` options.
1078+
1079+
1080+
Example migration from `cloudwatch_logs` to `cloudwatch`:
1081+
1082+
1083+
```
1084+
[OUTPUT]
1085+
Name cloudwatch_logs
1086+
Match MyTag
1087+
log_stream_prefix my-prefix
1088+
log_group_name my-group
1089+
auto_create_group true
1090+
auto_retry_requests true
1091+
net.keepalive Off
1092+
workers 1
1093+
```
1094+
1095+
After migration:
1096+
1097+
```
1098+
[OUTPUT]
1099+
Name cloudwatch
1100+
Match MyTag
1101+
log_stream_prefix my-prefix
1102+
log_group_name my-group
1103+
auto_create_group true
1104+
```
1105+
1106+
1107+
The following options are only supported with `Name` `cloudwatch` and must be *removed* if you switch to `Name` `cloudwatch_logs`.
1108+
1109+
* `default_log_group_name`
1110+
* `default_log_stream_name`
1111+
* `new_log_group_tags`
1112+
* `credentials_endpoint`
1113+
* If you use log group or stream name templating, each plugin has some support for this but the features and config option names are entirely different.
1114+
* https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit#templating-log-group-and-stream-names
1115+
* https://docs.fluentbit.io/manual/pipeline/outputs/cloudwatch#log-stream-and-group-name-templating-using-record_accessor-syntax
1116+
* With `cloudwatch` you can put `$()` template variables in the `log_group_name` and `log_stream_name` options. You can then use `default_log_group_name` and `default_log_stream_name` as fallback names if templating fails.
1117+
* Only `cloudwatch` supports direct templating of ECS metadata when you run in ECS: `$(ecs_task_id)`, `$(ecs_cluster `or `$(ecs_task_arn)`. With `cloudwatch_logs` you can only inject values from the log JSONs. If you want to use ECS Metadata in your config with `cloudwatch_logs` please see: https://github.com/aws-samples/amazon-ecs-firelens-examples/tree/mainline/examples/fluent-bit/init-metadata
1118+
* With `cloudwatch_logs` templates go in the `log_group_template` or `log_stream_template` and use a `$var` syntax (see doc). Fallback names if templating fails go in the `log_group_name`, `log_stream_name`, or` log_stream_prefix` options.
1119+
1120+
1121+
10531122
#### FireLens Tag and Match Pattern and generated config
10541123

10551124
If you use Amazon ECS FireLens to deploy Fluent Bit, then please be aware that some of the Fluent Bit configuration is managed by AWS. ECS will add a log input for your stdout/stderr logs. This single input captures all of the logs from each container that uses the `awsfirelens` log driver.

0 commit comments

Comments
 (0)