logcheck-test(1)

πŸ“¦
version 1.4.7build1 Β· 2 versions
  • 1.4.7build1 Β· alpine 3.22, alpine 3.23, alpine 3.24, debian bookworm, debian trixie, fedora 43, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.3.18 Β· epel 9
, in alpine 3.22, alpine 3.23, alpine 3.24, debian bookworm, debian trixie, fedora 43, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– logcheck-test β€” the manual page, but make it cute πŸ’–

okay bestie, gather round, because this is the logcheck-test page from the General Commands Manual and it's literally about testing your new logcheck rules without losing your entire mind. no cap. πŸ¦‹


✨ NAME ✨

logcheck-test β€” test new logcheck rules easily πŸŽ€


🌸 SYNOPSIS 🌸

logcheck-test [-q|-i] [-a|-s|-l FILE] [-e] [-P PREFIX] [-S SUFFIX] RULE
logcheck-test [-q|-i] [-a|-s|-l FILE] -r RULEFILE

like. that's the whole vibe. two shapes, both iconic. πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

so basically, logcheck-test parses a log file for matching lines β€” and those matches are specified by either a single RULE or a whole rule file. πŸ“

and here's the part that's giving main character energy: if you're using a single RULE, you can set a PREFIX and a SUFFIX so you can write new rules easily. that's the whole point. writing rules shouldn't be a whole ordeal, fr fr. ✨


🧚 OPTIONS 🧚

  • -h, --help β€” show usage information πŸ’– (the classic. the beloved.)
  • -a, --auth.log β€” parse /var/log/auth.log for matching lines πŸ”₯
  • -s, --syslog β€” parse /var/log/syslog for matching lines 🌈
  • -l, --log-file FILE β€” parse FILE for matching lines πŸ¦‹
  • -i, --invert-match β€” show lines that don't match the RULE or the RULEFILE πŸ™ˆ (the chaotic option. we stan.)
  • -q, --quiet β€” suppress the rule summary at the end of output 🀫
  • -e, --surround-rule β€” surround RULE with the standard prefix and suffix, which is exactly this:
^[[:alpha:]]{3} [ :[:digit:]]{11} [._[:alnum:]-]+ RULE$

so you don't have to type the whole thing yourself, bestie. you're welcome. πŸ’…

  • -P, --append-prefix PREFIX β€” append PREFIX to the rule prefix. this option can be given multiple times ✨
  • -S, --prepend-suffix SUFFIX β€” prepend SUFFIX to the rule suffix. this option can be given multiple times ✨
  • -r, --rule-file RULEFILE β€” use file RULEFILE for rule input πŸ“„

πŸŽ€ EXAMPLES πŸŽ€

with logcheck-test you can easily write and test new rules. like, genuinely easily. no stress. 🌸

test a single rule against /var/log/syslog:

logcheck-test -s "RULE"

test a single rule against ~/log, surround the rule with standard prefix and suffix, and append "kernel " to the prefix:

logcheck-test -l ~/log -e -P "kernel " "RULE"

test the rules in rulefiles/linux/ignore.d.server/kernel against ~/log:

logcheck-test -l ~/log -r rulefiles/linux/ignore.d.server/kernel

test which lines the rules in rulefiles/linux/ignore.d.server/kernel doesn't match:

logcheck-test -l ~/log -r rulefiles/linux/ignore.d.server/kernel -i

⭐ EXIT STATUS ⭐

  • on successful matching, logcheck-test will complete with exit code 0. slay. βœ…
  • an exit code of 1 indicates no successful matching. 😭
  • an exit code greater then 1 indicates an error occurred. textual errors are written to the standard error stream. πŸ’€
not me caring deeply about your exit codes but like… please check them. iykyk.

🫢 SEE ALSO 🫢


πŸ‘‘ AUTHOR πŸ‘‘

logcheck is developed by the Debian logcheck Team at: https://salsa.debian.org/debian/logcheck

this manual was written by Hannes von Haugwitz <hannes@vonhaugwitz.com>. absolute icon. πŸ’œ


and that's the whole page, bestie!! this one's from the General Commands Manual, and the footer said Feb 19, 2010 β€” so yeah, this manual has been out here being useful since 2010 and it's still serving. go write some rules. periodt. πŸ’–βœ¨πŸŽ€πŸ¦‹