logcheck-test(1)
π 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.logfor matching lines π₯-s,--syslogβ parse/var/log/syslogfor matching lines π-l,--log-fileFILE β 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-prefixPREFIX β append PREFIX to the rule prefix. this option can be given multiple times β¨-S,--prepend-suffixSUFFIX β prepend SUFFIX to the rule suffix. this option can be given multiple times β¨-r,--rule-fileRULEFILE β 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
1indicates 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. πβ¨ππ¦
π¦ where this page comes from
- alpine 3.22: logcheck-doc 1.4.3-r4 Β· GPL-2.0-or-later
- alpine 3.23: logcheck-doc 1.4.5-r0 Β· GPL-2.0-or-later
- alpine 3.24: logcheck-doc 1.4.7-r0 Β· GPL-2.0-or-later
- debian bookworm: logcheck 1.4.2+deb12u1 Β· GPL-2.0-only
- debian trixie: logcheck 1.4.5+deb13u1 Β· GPL-2.0-only
- fedora 43: logcheck 1.3.23-1.fc43 Β· GPL-2.0-only
- ubuntu jammy: logcheck 1.3.23
- ubuntu noble: logcheck 1.4.3 Β· GPL-2.0-only
- ubuntu questing: logcheck 1.4.5
- ubuntu resolute: logcheck 1.4.7build1 Β· GPL-2.0-only
- ubuntu stonking: logcheck 1.4.7build1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms