fluent-bit-go-loki

command module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

README

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
Key Description Default
Url Url of loki server API endpoint http://localhost:3100/loki/api/v1/push
BatchWait Time to wait before send a log batch to Loki, full or not. (unit: sec) 1 second
BatchSize Log batch size to send a log batch to Loki (unit: Bytes) 10 KiB (10*1024 Bytes)
Labels labels for API requests job="fluent-bit" (describe below)
LogLevel Specify log level info
RemoveKeys Comma separated list of needless record keys to remove. none
LabelKeys Comma 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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL