From 37a2f73e7c2e0921e52582e1e56517cb03eb4d61 Mon Sep 17 00:00:00 2001 From: deresolution20 <85902399+deresolution20@users.noreply.github.com> Date: Wed, 10 Jan 2024 13:49:47 -0700 Subject: [PATCH] Update _index.md (#11548) **What this PR does / why we need it**: doc is confusing/lacking detail on setting up regular fluentbit container and we needed an example config for fluent-bit that works with HG Loki. **Which issue(s) this PR fixes**: Fixes # **Special notes for your reviewer**: **Checklist** - [x] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) - [x] Documentation added - [ ] Tests updated - [ ] `CHANGELOG.md` updated - [ ] If the change is worth mentioning in the release notes, add `add-to-release-notes` label - [ ] Changes that require user attention or interaction to upgrade are documented in `docs/sources/setup/upgrade/_index.md` - [ ] For Helm chart changes bump the Helm chart version in `production/helm/loki/Chart.yaml` and update `production/helm/loki/CHANGELOG.md` and `production/helm/loki/README.md`. [Example PR](https://github.com/grafana/loki/commit/d10549e3ece02120974929894ee333d07755d213) - [ ] If the change is deprecating or removing a configuration option, update the `deprecated-config.yaml` and `deleted-config.yaml` files respectively in the `tools/deprecated-config-checker` directory. [Example PR](https://github.com/grafana/loki/pull/10840/commits/0d4416a4b03739583349934b96f272fb4f685d15) --- docs/sources/send-data/fluentbit/_index.md | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/sources/send-data/fluentbit/_index.md b/docs/sources/send-data/fluentbit/_index.md index 3e29bf367794..c9088fdc8f88 100644 --- a/docs/sources/send-data/fluentbit/_index.md +++ b/docs/sources/send-data/fluentbit/_index.md @@ -22,6 +22,43 @@ docker run -v /var/log:/var/log \ grafana/fluent-bit-plugin-loki:latest ``` +Or, an alternative is to run the fluent-bit container using [Docker Hub](https://hub.docker.com/r/fluent/fluent-bit) image: + +### Docker Container Logs + +To ship logs from Docker containers to Grafana Cloud using Fluent Bit, you can use the Fluent Bit Docker image and configure it to forward logs directly to Grafana Cloud's Loki. Below is a step-by-step guide on setting up Fluent Bit for this purpose. + +#### Prerequisites + +- Docker is installed on your machine. +- You have a Grafana Cloud account with access to Loki. + +#### Configuration + +1. Create a Fluent Bit configuration file named `fluent-bit.conf` with the following content, which defines the input from Docker container logs and sets up the output to send logs to your Grafana Cloud Loki instance: + + ```ini + [SERVICE] + Flush 1 + Log_Level info + + [INPUT] + Name tail + Path /var/lib/docker/containers/*/*.log + Parser docker + Tag docker.* + + [OUTPUT] + Name loki + Match * + Host logs-prod-006.grafana.net + Port 443 + TLS On + TLS.Verify On + HTTP_User 478625 + HTTP_Passwd YOUR_GRAFANA_CLOUD_API_KEY + Labels job=fluentbit + ### Kubernetes You can run Fluent Bit as a [Daemonset](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) to collect all your Kubernetes workload logs.