Skip to content

Commit a74c5c3

Browse files
authored
output: cloudwatch_logs: add documentation (#336)
Signed-off-by: Wesley Pettit <[email protected]>
1 parent 92dd7ff commit a74c5c3

File tree

5 files changed

+71
-3
lines changed

5 files changed

+71
-3
lines changed

.gitbook.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ redirects:
4646
output/azure: ./pipeline/outputs/azure.md
4747
output/bigquery: ./pipeline/outputs/bigquery.md
4848
output/counter: ./pipeline/outputs/counter.md
49+
output/cloudwatch: ./pipeline/outputs/cloudwatch.md
4950
output/datadog: ./pipeline/outputs/datadog.md
5051
output/es: ./pipeline/outputs/elasticsearch.md
5152
output/file: ./pipeline/outputs/file.md

SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
* [Nest](pipeline/filters/nest.md)
110110
* [Modify](pipeline/filters/modify.md)
111111
* [Outputs](pipeline/outputs/README.md)
112+
* [Amazon CloudWatch](pipeline/outputs/cloudwatch.md)
112113
* [Azure](pipeline/outputs/azure.md)
113114
* [BigQuery](pipeline/outputs/bigquery.md)
114115
* [Counter](pipeline/outputs/counter.md)
@@ -149,4 +150,3 @@
149150
* [Ingest Records Manually](development/ingest-records-manually.md)
150151
* [Golang Output Plugins](development/golang-output-plugins.md)
151152
* [Developer guide for beginners on contributing to Fluent Bit](development/developer-guide.md)
152-

administration/security.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The listed properties can be enabled in the configuration file, specifically on
2020

2121
The following **output** plugins can take advantage of the TLS feature:
2222

23+
* [Amazon CloudWatch](../pipeline/outputs/cloudwatch.md)
2324
* [Azure](../pipeline/outputs/azure.md)
2425
* [BigQuery](../pipeline/outputs/bigquery.md)
2526
* [Datadog](../pipeline/outputs/datadog.md)
@@ -90,4 +91,3 @@ Fluent Bit supports [TLS server name indication](https://en.wikipedia.org/wiki/S
9091
tls.ca_file /etc/certs/fluent.crt
9192
tls.vhost fluent.example.com
9293
```
93-

installation/sources/build-and-install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ The _output plugins_ gives the capacity to flush the information to some externa
158158
| [FLB\_OUT\_AZURE](../../pipeline/outputs/azure.md) | Enable Microsoft Azure output plugin | On |
159159
| [FLB\_OUT\_BIGQUERY](../../pipeline/outputs/bigquery.md) | Enable Google BigQuery output plugin | On |
160160
| [FLB\_OUT\_COUNTER](../../pipeline/outputs/counter.md) | Enable Counter output plugin | On |
161+
| [FLB\_OUT\_CLOUDWATCH\_LOGS](../../pipeline/outputs/cloudwatch.md) | Enable Amazon CloudWatch output plugin | On |
161162
| [FLB\_OUT\_DATADOG](../../pipeline/outputs/datadog.md) | Enable Datadog output plugin | On |
162163
| [FLB\_OUT\_ES](../../pipeline/outputs/elasticsearch.md) | Enable [Elastic Search](http://www.elastic.co) output plugin | On |
163164
| [FLB\_OUT\_FILE](../../pipeline/outputs/file.md) | Enable File output plugin | On |
@@ -179,4 +180,3 @@ The _output plugins_ gives the capacity to flush the information to some externa
179180
| [FLB\_OUT\_STDOUT]() | Enable STDOUT output plugin | On |
180181
| FLB\_OUT\_TCP | Enable TCP/TLS output plugin | On |
181182
| [FLB\_OUT\_TD](../../pipeline/outputs/treasure-data.md) | Enable [Treasure Data](http://www.treasuredata.com) output plugin | On |
182-

pipeline/outputs/cloudwatch.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Amazon CloudWatch
2+
3+
The Amazon CloudWatch output plugin allows to ingest your records into the [CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html) service. Support for CloudWatch Metrics is also provided via [EMF](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format_Specification.html).
4+
5+
This is the documentation for the core Fluent Bit CloudWatch plugin written in C. It can replace the [aws/amazon-cloudwatch-logs-for-fluent-bit](https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit) Golang Fluent Bit plugin released last year. The Golang plugin was named `cloudwatch`; this new high performance CloudWatch plugin is called `cloudwatch_logs` to prevent conflicts/confusion. Check the amazon repo for the Golang plugin for details on the deprecation/migration plan for the original plugin.
6+
7+
## Configuration Parameters
8+
9+
| Key | Description |
10+
| :--- | :--- |
11+
| region | The AWS region. |
12+
| log_group_name | The name of the CloudWatch Log Group that you want log records sent to. |
13+
| log_stream_name| The name of the CloudWatch Log Stream that you want log records sent to. |
14+
| log_stream_prefix| Prefix for the Log Stream name. The tag is appended to the prefix to construct the full log stream name. Not compatible with the log_stream_name option. |
15+
| log_key | By default, the whole log record will be sent to CloudWatch. If you specify a key name with this option, then only the value of that key will be sent to CloudWatch. For example, if you are using the Fluentd Docker log driver, you can specify `log_key log` and only the log message will be sent to CloudWatch. |
16+
| log_format | An optional parameter that can be used to tell CloudWatch the format of the data. A value of json/emf enables CloudWatch to extract custom metrics embedded in a JSON payload. See the [Embedded Metric Format](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format_Specification.html). |
17+
| role_arn | ARN of an IAM role to assume (for cross account access). |
18+
| auto_create_group | Automatically create the log group. Valid values are "true" or "false" (case insensitive). Defaults to false. |
19+
| endpoint | Specify a custom endpoint for the CloudWatch Logs API. |
20+
21+
## Getting Started
22+
23+
In order to send records into Amazon Cloudwatch, you can run the plugin from the command line or through the configuration file:
24+
25+
### Command Line
26+
27+
The **cloudwatch** plugin, can read the parameters from the command line through the **-p** argument \(property\), e.g:
28+
29+
```text
30+
$ fluent-bit -i cpu -o cloudwatch_logs -p log_group_name=group -p log_stream_name=stream -p region=us-west-2 -m '*' -f 1
31+
```
32+
33+
### Configuration File
34+
35+
In your main configuration file append the following _Output_ section:
36+
37+
```text
38+
[OUTPUT]
39+
Name cloudwatch_logs
40+
Match *
41+
region us-east-1
42+
log_group_name fluent-bit-cloudwatch
43+
log_stream_prefix from-fluent-bit-
44+
auto_create_group On
45+
```
46+
47+
### AWS for Fluent Bit
48+
49+
Amazon distributes a container image with Fluent Bit and these plugins.
50+
51+
##### GitHub
52+
53+
[github.com/aws/aws-for-fluent-bit](https://github.com/aws/aws-for-fluent-bit)
54+
55+
##### Docker Hub
56+
57+
[amazon/aws-for-fluent-bit](https://hub.docker.com/r/amazon/aws-for-fluent-bit/tags)
58+
59+
##### Amazon ECR
60+
61+
You can use our SSM Public Parameters to find the Amazon ECR image URI in your region:
62+
63+
```
64+
aws ssm get-parameters-by-path --path /aws/service/aws-for-fluent-bit/
65+
```
66+
67+
For more see [the AWS for Fluent Bit github repo](https://github.com/aws/aws-for-fluent-bit#public-images).

0 commit comments

Comments
 (0)