kraney / journaldtail

PoC for shipping systemd logs to grafana loki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

journaldtail

This is a small PoC to explore how to ship journald logs to grafana loki. This code is currently work in progress.

Any comments and suggestions are welcome.

I made this project since the promtail community is not sure if promtail will support journald. (see: grafana/loki#26 (comment) )

Building

To build this, you'll need cgo and the systemd headers installed - for example, on a Debian based system, apt-get install libsystemd-dev.

Journal fields

When you import Journald logs to loki, you'll see a large number of log labels. Its worth reading the systemd journal fields documentation to get a feel for what is available to you.

ToDo

  • Fix logging infrastructure in code
  • Enable configuration via flagext
  • Support relabeling config like in promtail
  • Tests
  • Build and release pipeline
  • Documentation
  • Store journald cursor position on disk to allow restart of journaldtail

About

PoC for shipping systemd logs to grafana loki


Languages

Language:Go 76.1%Language:Dockerfile 19.5%Language:Makefile 4.4%