You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the Amazon output plugin docs with YAML configuration examples. Fixes#1890. (#1891)
* Adding YAML examples and cleanup to Amazon CloudWatch output plugin. Part of issue #1890.
Signed-off-by: Eric D. Schabell <eric@schabell.org>
* Adding YAML examples and cleanup to Amazon Kinesis Data Firehose output plugin. Part of issue #1890.
Signed-off-by: Eric D. Schabell <eric@schabell.org>
* Adding YAML examples and cleanup to Amazon Kinesis Data Streams output plugin. Part of issue #1890.
Signed-off-by: Eric D. Schabell <eric@schabell.org>
* Adding YAML examples and cleanup to Amazon S3 output plugin. Part of issue #1890.
Signed-off-by: Eric D. Schabell <eric@schabell.org>
---------
Signed-off-by: Eric D. Schabell <eric@schabell.org>
With the above kubernetes metadata, the log group name will be `application-logs-ip-10-1-128-166.us-east-2.compute.internal.my-namespace`. And the log stream name will be `myapp-5468c5d4d7-n2swr.myapp`.
139
214
140
215
If the kubernetes structure is not found in the log record, then the `log_group_name` and `log_stream_prefix` will be used instead, and Fluent Bit will log an error like:
Notice in the example above, that the template values are separated by dot characters. This is important; the Fluent Bit record\_accessor library has a limitation in the characters that can separate template variables- only dots and commas (`.` and `,`) can come after a template variable. This is because the templating library must parse the template and determine the end of a variable.
223
+
Notice in the example above, that the template values are separated by dot characters. This is important; the Fluent Bit record\_accessor library has a limitation in the characters that can separate template variables; only dots and commas (`.` and `,`) can come after a template variable. This is because the templating library must parse the template and determine the end of a variable.
149
224
150
225
Assume that your log records contain the metadata keys `container_name` and `task`. The following would be invalid templates because the two template variables are not separated by commas or dots:
151
226
@@ -168,55 +243,130 @@ And the following are valid since they only contain one template variable with n
168
243
169
244
### Metrics Tutorial
170
245
171
-
Fluent Bit has different input plugins (cpu, mem, disk, netif) to collect host resource usage metrics. `cloudwatch_logs` output plugin can be used to send these host metrics to CloudWatch in Embedded Metric Format (EMF). If data comes from any of the abovementioned input plugins, `cloudwatch_logs` output plugin will convert them to EMF format and sent to CloudWatch as JSON log. Additionally, if we set `json/emf` as the value of `log_format` config option, CloudWatch will extract custom metrics from embedded JSON payload.
246
+
Fluent Bit has different input plugins (cpu, mem, disk, netif) to collect host resource usage metrics. `cloudwatch_logs` output plugin can be used to send these host metrics to CloudWatch in Embedded Metric Format (EMF). If data comes from any of the above-mentioned input plugins, `cloudwatch_logs` output plugin will convert them to EMF format and sent to CloudWatch as JSON log. Additionally, if we set `json/emf` as the value of `log_format` config option, CloudWatch will extract custom metrics from embedded JSON payload.
172
247
173
248
Note: Right now, only `cpu` and `mem` metrics can be sent to CloudWatch.
174
249
175
250
For using the `mem` input plugin and sending memory usage metrics to CloudWatch, we can consider the following example config file. Here, we use the `aws` filter which adds `ec2_instance_id` and `az` (availability zone) to the log records. Later, in the output config section, we set `ec2_instance_id` as our metric dimension.
176
251
252
+
{% tabs %}
253
+
{% tab title="fluent-bit.yaml" %}
254
+
255
+
```yaml
256
+
service:
257
+
log_level: info
258
+
259
+
pipeline:
260
+
inputs:
261
+
- name: mem
262
+
tag: mem
263
+
264
+
filters:
265
+
- name: aws
266
+
match: '*'
267
+
268
+
outputs:
269
+
- name: cloudwatch_logs
270
+
match: '*'
271
+
region: us-west-2
272
+
log_stream_name: fluent-bit-cloudwatch
273
+
log_group_name: fluent-bit-cloudwatch
274
+
log_format: json/emf
275
+
metric_namespace: fluent-bit-metrics
276
+
metric_dimensions: ec2_instance_id
277
+
auto_create_group: true
177
278
```
279
+
280
+
{% endtab %}
281
+
{% tab title="fluent-bit.conf" %}
282
+
283
+
```text
178
284
[SERVICE]
179
285
Log_Level info
180
286
181
287
[INPUT]
182
288
Name mem
183
289
Tag mem
184
-
290
+
185
291
[FILTER]
186
292
Name aws
187
293
Match *
188
294
189
295
[OUTPUT]
190
296
Name cloudwatch_logs
191
297
Match *
298
+
region us-west-2
192
299
log_stream_name fluent-bit-cloudwatch
193
300
log_group_name fluent-bit-cloudwatch
194
-
region us-west-2
195
301
log_format json/emf
196
302
metric_namespace fluent-bit-metrics
197
303
metric_dimensions ec2_instance_id
198
304
auto_create_group true
199
305
```
200
306
307
+
{% endtab %}
308
+
{% endtabs %}
309
+
201
310
The following config will set two dimensions to all of our metrics- `ec2_instance_id` and `az`.
202
311
312
+
{% tabs %}
313
+
{% tab title="fluent-bit.yaml" %}
314
+
315
+
```yaml
316
+
service:
317
+
log_level: info
318
+
319
+
pipeline:
320
+
inputs:
321
+
- name: mem
322
+
tag: mem
323
+
324
+
filters:
325
+
- name: aws
326
+
match: '*'
327
+
328
+
outputs:
329
+
- name: cloudwatch_logs
330
+
match: '*'
331
+
region: us-west-2
332
+
log_stream_name: fluent-bit-cloudwatch
333
+
log_group_name: fluent-bit-cloudwatch
334
+
log_format: json/emf
335
+
metric_namespace: fluent-bit-metrics
336
+
metric_dimensions: ec2_instance_id,az
337
+
auto_create_group: true
203
338
```
339
+
340
+
{% endtab %}
341
+
{% tab title="fluent-bit.conf" %}
342
+
343
+
```text
344
+
[SERVICE]
345
+
Log_Level info
346
+
347
+
[INPUT]
348
+
Name mem
349
+
Tag mem
350
+
204
351
[FILTER]
205
352
Name aws
206
353
Match *
207
354
208
355
[OUTPUT]
209
356
Name cloudwatch_logs
210
357
Match *
358
+
region us-west-2
211
359
log_stream_name fluent-bit-cloudwatch
212
360
log_group_name fluent-bit-cloudwatch
213
-
region us-west-2
214
361
log_format json/emf
215
362
metric_namespace fluent-bit-metrics
216
363
metric_dimensions ec2_instance_id,az
217
364
auto_create_group true
218
365
```
219
366
367
+
{% endtab %}
368
+
{% endtabs %}
369
+
220
370
### AWS for Fluent Bit
221
371
222
372
Amazon distributes a container image with Fluent Bit and these plugins.
@@ -231,19 +381,19 @@ Amazon distributes a container image with Fluent Bit and these plugins.
231
381
232
382
Our images are available in Amazon ECR Public Gallery. You can download images with different tags by following command:
0 commit comments