[SERVICE] # See: # https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html # https://github.com/aws-samples/amazon-ecs-firelens-under-the-hood/tree/master/generated-configs/fluent-bit HTTP_Server On HTTP_Listen 0.0.0.0 HTTP_PORT 2020 Flush 1 Grace 30 Log_Level info storage.path /var/log/flb-storage/ {{#if definitions.segfault}} # Artificially trigger a segfault if configured [INPUT] Name exec command kill -11 `pgrep fluent-bit` {{/if}} {{#if definitions.add_forward}} # This is an artificial forward because my standard out logger was going to some other destination not the cw specified here. [INPUT] Name forward Listen 0.0.0.0 Port 6270 {{/if}} [INPUT] Name tcp Listen 0.0.0.0 # Tag used for routing to OUTPUT Tag ApplicationLogs # Listen on unused port Port 5170 # Don't parse JSON for performance reasons Format none Chunk_Size 32 Buffer_Size 64 storage.type filesystem # Important! Every INPUT section's Mem_Buf_Limit must be re-computed when # the container memory's limit or the number of of INPUT sections change. If you # update this value, confirm that the container memory limit in the task # definition is correct. Also note that an additional INPUT section is # configured by default, so count the INPUTs in this file and add 1. # Mem_Buf_Limit <= Memory_limit / 2 / (number of INPUT sections + 1) # 64MB = 512MB / 2 / (4 INPUT sections) Mem_Buf_Limit 64MB [INPUT] Name tcp Tag RequestLogs Listen 0.0.0.0 Port 5171 Format none Chunk_Size 32 Buffer_Size 64 storage.type filesystem # Important! Every INPUT section's Mem_Buf_Limit must be re-computed when # the container memory's limit or the number of of INPUT sections change. If you # update this value, confirm that the container memory limit in the task # definition is correct. Also note that an additional INPUT section is # configured by default, so count the INPUTs in this file and add 1. # Mem_Buf_Limit <= Memory_limit / 2 / (number of INPUT sections + 1) # 64MB = 512MB / 2 / (4 INPUT sections) Mem_Buf_Limit 64MB [INPUT] Name tail Tag ServiceMetrics Path /tmp/data_logs/service_log_1.txt Exclude_Path *.gz Rotate_Wait 15 Multiline On Parser_Firstline QueryLogSeparator Parser_1 QueryLog # Important! Every INPUT section's Mem_Buf_Limit must be re-computed when # the container memory's limit or the number of of INPUT sections change. If you # update this value, confirm that the container memory limit in the task # definition is correct. Also note that an additional INPUT section is # configured by default, so count the INPUTs in this file and add 1. # Mem_Buf_Limit <= Memory_limit / 2 / (number of INPUT sections + 1) # 64MB = 512MB / 2 / (4 INPUT sections) Mem_Buf_Limit 64MB [OUTPUT] # Send any StdOut/StdErr Logs to A CloudWatch Logs Group. # FireLens automatically tags them to {container name}-firelens-{task ID}. Name cloudwatch_logs Match Application-firelens-* region {{config.region}} log_group_name {{definitions.ServiceName}}-${STAGE}-AppContainer-STDOUT log_stream_prefix STDOUT-${HOSTNAME} auto_create_group {{definitions.cw_auto_create_group}} retry_limit 3 {{#if definitions.cw_use_mock}} tls.verify false port 4545 endpoint {{definitions.endpoint_mock}} {{/if}} [OUTPUT] # Send any Application Logs to A CloudWatch Logs Group Name cloudwatch_logs Match ApplicationLogs region {{config.region}} log_group_name {{definitions.ServiceName}}-${STAGE}-ApplicationLogs log_stream_prefix ApplicationLogs-${HOSTNAME} log_key log auto_create_group {{definitions.cw_auto_create_group}} retry_limit 3 {{#if definitions.cw_use_mock}} tls.verify false port 4545 endpoint {{definitions.endpoint_mock}} {{/if}} [OUTPUT] # Send any Request Logs to A CloudWatch Logs Group Name cloudwatch_logs Match RequestLogs region {{config.region}} log_group_name {{definitions.ServiceName}}-${STAGE}-RequestLogs log_stream_prefix RequestLogs-${HOSTNAME} log_key log auto_create_group {{definitions.cw_auto_create_group}} retry_limit 3 {{#if definitions.cw_use_mock}} tls.verify false port 4545 endpoint {{definitions.endpoint_mock}} {{/if}} [OUTPUT] # Send any ServiceMetrics Logs to A CloudWatch Logs Group Name cloudwatch_logs Match ServiceMetrics region {{config.region}} log_group_name {{definitions.ServiceName}}-${STAGE}-ServiceMetrics log_stream_prefix ServiceMetrics-${HOSTNAME} log_key log auto_create_group {{definitions.cw_auto_create_group}} retry_limit 3 {{#if definitions.cw_use_mock}} tls.verify false port 4545 endpoint {{definitions.endpoint_mock}} {{/if}}