Last active
October 4, 2023 00:28
-
-
Save lk86/5db1514f0e3225170f1a9b2ea84ae00b to your computer and use it in GitHub Desktop.
mina-log script for parsing journalctl output with mina-logproc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
case ${1} in | |
info|info-only) | |
FILTER='.level == "Info"';; | |
debug) | |
FILTER='.level in ["Debug", "Info", "Warn", "Error"]';; | |
debug-only) | |
FILTER='.level in ["Debug"]';; | |
spam) | |
FILTER='.level in ["Spam", "Debug", "Info", "Warn", "Error"]';; | |
all) | |
FILTER='.level in ["Info", "Warn", "Error"]';; | |
*) | |
FILTER="";; | |
esac | |
# Set some prefix here if you use a custom mina systemd service with a different name | |
# for a service named "my-special-mina.service" set SERVICE_PREFIX="my-special-" | |
SERVICE_PREFIX="" | |
journalctl --user -u ${SERVICE_PREFIX}mina -o cat --lines 100 --follow | mina-logproc -p -m 255 -i inline -f "${FILTER}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment