Configuration¶
Fluent Bit reads one file, /etc/fluent-bit/fluent-bit.conf. This page
explains the default pipeline and how to add your own outputs.
Where things live¶
| Path | What it is |
|---|---|
/etc/fluent-bit/fluent-bit.conf |
The Fluent Bit configuration |
/var/lib/fluent-bit/storage/ |
Filesystem buffer |
/var/lib/fluent-bit/out/accepted.log |
The default local destination |
/var/lib/fluent-bit/tls/ |
This instance's certificate and private key |
/usr/local/share/sushi/fluent-bit/cert.pem |
Public copy of the certificate, for clients |
/opt/fluent-bit/bin/fluent-bit |
The Fluent Bit binary |
First boot writes fluent-bit.conf only if it does not exist yet, so your
edits are kept across reboots.
The default pipeline¶
- Service. The monitoring API listens on
127.0.0.1:2020. The buffer is in/var/lib/fluent-bit/storage. - Input. An
httpinput namedlocal-ingestlistens on127.0.0.1:9880with TLS, tags recordsingest.local, returns HTTP 201 on success, and exposes/health. It uses the filesystem buffer, withMem_Buf_Limit 2MB. - Output. A
fileoutput namedlocal-filematchesingest.localand writes plain lines to/var/lib/fluent-bit/out/accepted.log. Its queued chunks are limited bystorage.total_limit_size 32M, and it retries a failed write up to five times (Retry_Limit 5).
Apply changes¶
sudo nano /etc/fluent-bit/fluent-bit.conf
sudo systemctl restart fluent-bit
systemctl is-active fluent-bit
If the service does not come back, the log shows why:
Send logs to CloudWatch Logs¶
- Create an IAM role that allows Fluent Bit to write to your log group, scoped to that log group, and attach it to the instance. Do not put access keys in the config file.
-
Add an output to
fluent-bit.conf: -
Restart Fluent Bit and check the log.
Send logs to S3¶
- Create an IAM role that allows Fluent Bit to write to your bucket, scoped to that bucket, and attach it to the instance.
-
Create a local store directory for the S3 output. Keep it under
/var/lib/fluent-bit, because that is the only place the service can write: -
Add an output:
-
Restart Fluent Bit and check the log.
The S3 output has its own buffer: store_dir_limit_size limits it, not
storage.total_limit_size. Include that directory in your backups. Test the
output with your own bucket and role before you rely on it.
Accept logs from other hosts¶
Ingest listens on 127.0.0.1 only. To accept logs from other hosts in your
VPC, either leave Fluent Bit on loopback and put a proxy you control in front
of it, or change Listen in the [INPUT] section to a private address and
allow only your own network in the security group.
Ingest has no client authentication
The certificate lets clients verify the server, but the input does not
ask clients for a certificate or token. Any process that can reach the
port can send logs. Do not bind ingest or the monitoring API to 0.0.0.0
or open them to the internet.
The walkthrough checks the defaults
demo.sh and the self-test it runs check the image's default settings.
After you change the configuration, they can report a failure even when
your setup works. Run them on a fresh instance, before you make changes.
Next: Operations.