https://github.com/cosmo0920/fluent-bit-go-cloudwatch-logs
fluent-bit output plugin for Amazon CloudWatch. https://aws.amazon.com/cloudwatch/
https://github.com/cosmo0920/fluent-bit-go-cloudwatch-logs
amazon-cloudwatch cloudwatch-logs fluent-bit fluentd golang
Last synced: 7 months ago
JSON representation
fluent-bit output plugin for Amazon CloudWatch. https://aws.amazon.com/cloudwatch/
- Host: GitHub
- URL: https://github.com/cosmo0920/fluent-bit-go-cloudwatch-logs
- Owner: cosmo0920
- License: apache-2.0
- Created: 2019-05-23T07:58:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-04T01:53:51.000Z (over 6 years ago)
- Last Synced: 2025-01-18T19:59:10.546Z (9 months ago)
- Topics: amazon-cloudwatch, cloudwatch-logs, fluent-bit, fluentd, golang
- Language: Go
- Size: 1.23 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fluent-bit cloudwatch-logs output plugin
[](https://travis-ci.org/cosmo0920/fluent-bit-go-cloudwatch-logs)
[](https://ci.appveyor.com/project/cosmo0920/fluent-bit-go-cloudwatch-logs/branch/master)Windows binaries are available in [release pages](https://github.com/cosmo0920/fluent-bit-go-cloudwatch-logs/releases).
This plugin works with fluent-bit's go plugin interface. You can use fluent-bit-go-cloudwatch-logs to ship logs into AWS CloudWatch.
The configuration typically looks like:
```graphviz
fluent-bit --> AWS CloudWatch
```# Usage
```bash
$ fluent-bit -e /path/to/built/out_cloudwatch_logs.so -c fluent-bit.conf
```# Prerequisites
* Go 1.11+
* gcc (for cgo)## Building
```bash
$ make
```### Configuration Options
| Key | Description | Default value | Note |
|-------------------|---------------------------------|---------------|---------------------------------|
| Credential | URI of AWS shared credential | `""` |(See [Credentials](#credentials))|
| AccessKeyID | Access key ID of AWS | `""` |(See [Credentials](#credentials))|
| SecretAccessKey | Secret access key ID of AWS | `""` |(See [Credentials](#credentials))|
| LogGroupName | logGroup name of CloudWatch | `-` | Mandatory parameter |
| LogStreamName | logStream name of CloudWatch | `-` | Mandatory parameter |
| Region | Region of CloudWatch | `-` | Mandatory parameter |
| AutoCreateStream | Use auto create stream feature? | `true` | Optional parameter |Example:
add this section to fluent-bit.conf
```properties
[Output]
Name cloudwatch_logs
Match *
# Credential /path/to/sharedcredentialfile
AccessKeyID yourawsaccesskeyid
SecretAccessKey yourawssecretaccesskey
LogGroupName yourloggroupname
LogStreamName yourslogstreamname
Region us-east-1
# AutoCreateStream false # default: true
```fluent-bit-go-cloudwatch-logs supports the following credentials. Users must specify one of them:
## Credentials
Specifying credentials is **required**.
This plugin supports the following credentials:
### Shared Credentials
Create the following file which includes credentials:
```ini
[default]
aws_access_key_id = YOUR_AWS_ACCESS_KEY_ID
aws_secret_access_key = YOUR_AWS_SECRET_ACCESS_KEY
```And specify the following parameter in fluent-bit configuration:
```ini
Credential /path/to/sharedcredentialfile
```### Static Credentials
Specify the following parameters in fluent-bit configuration:
```ini
AccessKeyID yourawsaccesskeyid
SecretAccessKey yourawssecretaccesskey
```### Environment Credentials
Specify `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` as environment variables.
## Useful links
* [fluent-bit-go](https://github.com/fluent/fluent-bit-go)