[release-2.9.x] Update _index.md (#11644)

Backport 37a2f73e7c from #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 #<issue number>

**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](d10549e3ec)
- [ ] 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](0d4416a4b0)

Co-authored-by: deresolution20 <85902399+deresolution20@users.noreply.github.com>
pull/11664/head
Grot (@grafanabot) 1 year ago committed by GitHub
parent ce4065bb09
commit 732e7999ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 37
      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.

Loading…
Cancel
Save