|
16 | 16 | - [Searching old issues](#searching-old-issues) |
17 | 17 | - [Downgrading or upgrading your version](#downgrading-or-upgrading-your-version) |
18 | 18 | - [Network Connection Issues](#network-connection-issues) |
| 19 | + - [What will the logs collected by Fluent Bit look like?](#what-will-the-logs-collected-by-fluent-bit-look-like) |
19 | 20 | - [Memory Leaks or high memory usage](#memory-leaks-or-high-memory-usage) |
20 | 21 | - [High Memory usage does not always mean there is a leak/bug](#high-memory-usage-does-not-always-mean-there-is-a-leakbug) |
21 | 22 | - [FireLens OOMKill Prevention Guide](#firelens-oomkill-prevention-guide) |
|
26 | 27 | - [Throttling, Log Duplication & Ordering](#throttling-log-duplication--ordering) |
27 | 28 | - [Recommendations for throttling](#recommendations-for-throttling) |
28 | 29 | - [Plugin Specific Issues](#plugin-specific-issues) |
29 | | - - [rewrite_tag filter and cycles in the log pipeline](#rewritetag-filter-and-cycles-in-the-log-pipeline) |
| 30 | + - [rewrite_tag filter and cycles in the log pipeline](#rewrite_tag-filter-and-cycles-in-the-log-pipeline) |
30 | 31 | - [Use Rubular site to test regex](#use-rubular-site-to-test-regex) |
31 | 32 | - [Chunk_Size and Buffer_Size for large logs in TCP Input](#chunk_size-and-buffer_size-for-large-logs-in-tcp-input) |
32 | 33 |
|
@@ -248,6 +249,37 @@ Remember that we also have older Golang output plugins for AWS (no longer recomm |
248 | 249 |
|
249 | 250 | Consequently, the AWS team contributed an `auto_retry_requests` config option for each of the core AWS outputs. This will issue an immediate retry for any connection issues. |
250 | 251 |
|
| 252 | +#### What will the logs collected by Fluent Bit look like? |
| 253 | + |
| 254 | +This depends on what input the logs were collected with. However, in general, the raw log line for a container is encapsulated in a `log` key and a JSON is created like: |
| 255 | + |
| 256 | +``` |
| 257 | +{ |
| 258 | + "log": "actual line from container here", |
| 259 | +} |
| 260 | +``` |
| 261 | + |
| 262 | +Fluent Bit internally stores JSON encoded as msgpack. Fluent Bit can only process/ingest logs as JSON/msgpack. With FireLens, your stdout & stderr logs would look like this with if you have not disabled `enable-ecs-log-metadata`: |
| 263 | + |
| 264 | +``` |
| 265 | +{ |
| 266 | + "source": "stdout", |
| 267 | + "log": "116.82.105.169 - Homenick7462 197 [2018-11-27T21:53:38Z] \"HEAD /enable/relationships/cross-platform/partnerships\" 501 13886", |
| 268 | + "container_id": "e54cccfac2b87417f71877907f67879068420042828067ae0867e60a63529d35", |
| 269 | + "container_name": "/ecs-demo-6-container2-a4eafbb3d4c7f1e16e00" |
| 270 | + "ecs_cluster": "mycluster", |
| 271 | + "ecs_task_arn": "arn:aws:ecs:us-east-2:01234567891011:task/mycluster/3de392df-6bfa-470b-97ed-aa6f482cd7a6", |
| 272 | + "ecs_task_definition": "demo:7" |
| 273 | + "ec2_instance_id": "i-06bc83dbc2ac2fdf8" |
| 274 | +} |
| 275 | +``` |
| 276 | + |
| 277 | +The first 4 fields are added by the [Fluentd Docker Log Driver](https://docs.docker.com/config/containers/logging/fluentd/). The 4 ECS metadata fields are added by FireLens and are explained here: |
| 278 | +* [FireLens example generated config](https://github.com/aws-samples/amazon-ecs-firelens-under-the-hood/blob/mainline/generated-configs/fluent-bit/generated_by_firelens.conf) |
| 279 | +* [FireLens Under the Hood](https://aws.amazon.com/blogs/containers/under-the-hood-firelens-for-amazon-ecs-tasks/) |
| 280 | + |
| 281 | +If you are using CloudWatch as your destination, there are additional considerations if you use the `log_key` option to just send the raw log line: [What if I just want the raw log line to appear in CW?](https://github.com/aws-samples/amazon-ecs-firelens-examples/tree/mainline/examples/fluent-bit/cloudwatchlogs#what-if-i-just-want-the-raw-log-line-from-the-container-to-appear-in-cloudwatch). |
| 282 | + |
251 | 283 | ### Memory Leaks or high memory usage |
252 | 284 |
|
253 | 285 | #### High Memory usage does not always mean there is a leak/bug |
|
0 commit comments