Sign inSign up

cosmo0920/fluent-bit-go-loki

By cosmo0920

•Updated almost 7 years ago

Image
0

655

cosmo0920/fluent-bit-go-loki repository overview

⁠fluent-bit loki output plugin

NOTICE! fluent-bit-go-loki is now merged in loki repository⁠.

Build Status Build status

Windows binaries are available in release pages⁠.

DockerHub base images is available in DockerHub⁠.

This plugin works with fluent-bit's go plugin interface. You can use fluent-bit loki to ship logs into grafana datasource with loki.

The configuration typically looks like:

fluent-bit → loki → grafana ← other grafana sources

⁠Usage

$ fluent-bit -e /path/to/built/out_loki.so -c fluent-bit.conf

Or,

$ docker build . -t fluent-bit/loki-plugin

and then, specify Url parameter as environment variable:

$ docker run -it -e="LOKI_URL=http://[YOURHOST]:[YOURPORT]/loki/api/v1/push" fluent-bit/loki-plugin

Using docker image from docker hub.

$ docker pull cosmo0920/fluent-bit-go-loki:latest

Other released images are available in DockerHub's fluent-bit-go-loki image tags⁠.

⁠Prerequisites

  • Go 1.11+
  • gcc (for cgo)
  • make (for Makefile)

⁠Building

$ make
⁠Configuration Options
KeyDescriptionDefault
UrlUrl of loki server API endpointhttp://localhost:3100/loki/api/v1/push⁠
BatchWaitTime to wait before send a log batch to Loki, full or not. (unit: sec)1 second
BatchSizeLog batch size to send a log batch to Loki (unit: Bytes)10 KiB (10*1024 Bytes)
Labelslabels for API requestsjob="fluent-bit" (describe below)
LogLevelSpecify log levelinfo
RemoveKeysComma separated list of needless record keys to remove.none
LabelKeysComma separated list of keys to use as stream labels.none

Example:

add this section to fluent-bit.conf

[Output]
    Name loki
    Match *
    Url http://localhost:3100/loki/api/v1/push
    BatchWait 10 # (10msec)
    BatchSize 30 # (30KiB)
    Labels {test="fluent-bit-go",lang="Golang"}
    RemoveKeys key1,key2

Tag summary

Content type

Image

Digest

Size

36.9 MB

Last updated

almost 7 years ago

docker pull cosmo0920/fluent-bit-go-loki