Skip to content

Commit

Permalink
Update _index.md (#11548)
Browse files Browse the repository at this point in the history
**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](d10549e)
- [ ] 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](0d4416a)
  • Loading branch information
deresolution20 authored Jan 10, 2024
1 parent 03156ed commit 37a2f73
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docs/sources/send-data/fluentbit/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 37a2f73

Please sign in to comment.