81 stable releases
new 1.159.0 | Apr 12, 2025 |
---|---|
1.157.0 | Mar 19, 2025 |
1.147.0 | Feb 21, 2025 |
1.137.0 | Dec 27, 2024 |
0.0.0 | Jul 1, 2022 |
#294 in Network programming
349 downloads per month
16KB
170 lines
journal-forwarder
A simple script to forward journald logs over HTTP somewhat reliabily.
Configuration
All the configuration is passed in as environment variables. Either JF_URL
or JF_URL_SRC
is required.
JF_DEBUG
If set to a non-empty string batches are printed to stdout rather than being sent to the configured target.
JF_BATCH
The maximum number of entries to include in a batch. Entries are only sent in batches when logs are backed up. Once caught up entries are always sent live.
Defaults to 100.
JF_CURSOR
The path to a file where to store the cursor of previously transmitted logs. If this file does not exist it will be created and all logs will be uploaded.
Defaults to ./journal-forwarder.cursor
.
JF_EXCLUDE_0
A sequence of field matches that are excluded from uploading. Each is given a sequential number starting with 0
. Processing stops at the first missing number.
Each variable must be in the form FIELD=value
. Exact matches for this pair are excluded. Any matching exclude is sufficient to prevent a log from being uploaded. Multiple excludes for the same field are possible.
Defaults to no excludes.
JF_METHOD
The HTTP method to use for sending logs.
Defaults to POST
.
JF_URL
or JF_URL_SRC
The URL where to upload the logs. JF_URL
is the URL directly, if not set JF_URL_SRC
is a path from where to read the URL.
This value is required.
Requirements
On nixos the following packages are required:
- coreutils
- curl
- gnused
- jq
- systemd
- utillinux (butilt with systemd support)
Questions
Open an issue so that I can answer and add docs.
Dependencies
~6–19MB
~290K SLoC