-
Notifications
You must be signed in to change notification settings - Fork 10
/
fluent-bit.conf
156 lines (138 loc) · 5.3 KB
/
fluent-bit.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
[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}}