Skip to content

Instantly share code, notes, and snippets.

@lk86
Last active October 4, 2023 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lk86/5db1514f0e3225170f1a9b2ea84ae00b to your computer and use it in GitHub Desktop.
Save lk86/5db1514f0e3225170f1a9b2ea84ae00b to your computer and use it in GitHub Desktop.
mina-log script for parsing journalctl output with mina-logproc
#!/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