Journal2gelf
Ships new systemd journal entries to a remote destination in Graylog Extended Log Format (GELF)
Install / Use
/learn @systemd/Journal2gelfREADME
journal2gelf
Export structured log records from the systemd journal and send them to a Graylog2 server as GELF messages.
Tested on Python 2.7 and Fedora 17 (systemd-44-17) and Fedora 19 (systemd-204).
journalctl output format change
Starting with systemd-190 journalctl switched to an easier to parse single-line JSON format. This is now the default expected format as of journal2gelf v0.0.3.
For versions of systemd < 190, you must add the -m switch.
Run journalctl --version to get the systemd version.
Dependencies:
- graypy
Install
On Fedora 17+ (or other systems with a version of systemd that includes journal support):
sudo yum install git python-pip
pip-python install git+http://github.com/systemd/journal2gelf.git#egg=journal2gelf
Running as a service
Copy and edit the included examples/journal2gelf.service to
/etc/systemd/system.
Usage:
By default, journal2gelf will look for input on stdin. eg:
-
Send all logs and exit:
journalctl -o json | journal2gelf
The -t flag can be specified and journal2gelf will automatically
start journalctl in tail mode. This makes it easier to run as a systemd service.
journal2gelf -t
This is equivalent to running:
journalctl -o json -f | journal2gelf
Graylog2 server and port can be specified with -s and -p flags.
License
Copyright 2012 Joe Miller https://github.com/joemiller
Released under the MIT license, see LICENSE for details.
Related Skills
node-connect
353.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
353.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
