lokitee

command module
v0.0.0-...-9c4931a Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

README

lokitee

lokitee streams lines of text from stdin, forwarding it to stdout and to Grafana Loki.

Credentials to Loki can be set via flag or environment variable:

  • -addr or $LOKI_ADDR: Base URL of Loki to connect to (i.e., http://localhost:8080)
  • -username or $LOKI_USERNAME: Basic auth username to use for requests. Optional.
  • -password or $LOKI_PASSWORD: Basic auth password to use for requests. Optional.

By default, sent logs are written with the label set {job="lokitee"}. This can be changed with the -labels flag.

Installing

Use Go to install:

go install github.com/rfratto/lokitee@main

Examples

Write Hello, world to Loki:

echo "Hello, world!" | lokitee

Gotchas

lokitee currently splits lines from stdin and sends each line to Loki, preventing you from having one log entry that spans multiple lines.

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