logtool(1)

πŸ’– logtool(1) β€” the General Commands Manual page, but make it a group chat πŸ’–

okay bestie, welcome to logtool, section 1 of the General Commands Manual (the LOCAL one, we'll get to that). buckle up πŸŽ€


✨ NAME ✨

logtool β€” parse and filter syslog files. that's it. that's the whole job. and she ATE πŸ’…


🌸 SYNOPSIS 🌸

(stdout) | logtool -[args]

so here's the tea, bestie: logtool is a command line program that takes your logfiles and turns them into something actually palatable, because raw syslog is giving "unreadable wall of text" and we are NOT doing that today πŸ™ˆ

she'll take literally anything that looks even vaguely like a syslog file or a multilog file, and also just straight-up unformatted ASCII, and crunch it all into one of these formats for your viewing pleasure:

  • ANSI β€” colorized, for easy "at a glance" viewing πŸ‘‘
  • ASCII β€” for e-mail reports and terminals that don't do color
  • CSV β€” for spreadsheet and database imports
  • HTML β€” for generating web pages 🌈
  • RAW β€” for no good reason πŸ’€ (their words, not mine)

πŸ¦‹ OPTIONS πŸ¦‹

  • -o [ ANSI | ASCII | CSV | HTML | RAW ] β€” lets you pick your output format, one of: ANSI (this is the default), ASCII, CSV, HTML, RAW. and listen, the options are not case sensitive, so -o CSV and -o csv should yield the same results. we love an unbothered queen ✨
  • -t [ long | short ] β€” pick how time gets displayed. your choices: (Long, the default) Mon Dy HH:MM:SS, or (Short) HH:MM. pick your fighter πŸ•
  • -b β€” makes logtool beep on RED events. ANSI output only, so don't come crying to me if you're in CSV and nothing goes beep 😭 this one is genuinely useful when you wanna monitor a logfile on an ongoing basis and you want your terminal to beep whenever something out of the ordinary happens. it's giving "alarm but make it cute."
  • -s β€” tells logtool to not display the syslog "source" field.
  • -p β€” tells logtool to not display the "program" field.
  • -c [/path/config.file] β€” lets you specify a config file other than the default, which is /etc/logtool/logtool.conf.
  • -i [/path/includefile] β€” lets you specify an alternate file containing regex's for inclusion. default is /etc/logtool/include.
  • -e [/path/excludefile] β€” lets you specify an alternate file containing regex's for exclusion. default is /etc/logtool/exclude.
  • -n β€” makes logtool skip any attempts to resolve IP β†’ Hostname by the various modules. lowkey a lifesaver when your DNS is temporarily down, bestie 🫢
  • -v β€” set logtool to operate in verbose mode. (does nothing currently πŸ™ˆ iconic behavior honestly)
  • -V β€” causes logtool to print its version information and exit.
  • -h β€” display the help message. when in doubt, -h it out πŸ’–

πŸ”₯ SUGGESTED USAGE(S) πŸ”₯

as a 'live' logfile monitoring tool:

tail -f /var/log/messages | logtool -o ANSI -b

to generate colorized webpages of logfiles:

cat /var/log/messages | logtool -o HTML >
/home/httpd/html/logs/messages.html

to generate reports via a cronjob:

retail /var/log/messages | logtool -o ASCII | mail -s "Daily
report" someuser@somedomain.ext

(and yes, that third one says retail. I am simply the messenger, bestie. copy it exactly, no cap πŸ’…)


πŸ’œ CONFIG FILE πŸ’œ

/etc/logtool/logtool.conf

the config file should be commented to the point of being self-documenting, so we are not gonna comment very extensively on it here. suffice to say, this is THE place where you should configure 99% of your runtime options for logtool ✨

you may also have a collection of different default configurations, and select amongst them by the '-c' option of logtool. build-a-config workshop, we love to see it πŸŽ€


⭐ AVAILABILITY ⭐

Logtool is known to compile and run on all UNIX flavors using a 2.95.x GNU C Compiler, the GNU Make utility, and a proper ANSI C library (glibc is recommended, but not required).

specific reports of success include FreeBSD, OpenBSD, Solaris, SunOS, AIX, SCO, and of course, any known flavor of Linux (including at least 2 embedded system variants). she's everywhere. she's universal. she's the moment πŸŒπŸ‘‘


🌈 SEE ALSO 🌈

  • regex(7) β€” for help with constructing regular expressions for the include/exclude/colors files. if you find no regex manual on your system, try 'apropos regex' and see what you get, or as a last ditch, 'man grep' should at least point you in the right direction 🧭
  • you can also find a somewhat better bit of documentation in the textfile 'logtool.txt' (usually in the /usr/doc/, /usr/share/doc/ or similar tree on most Linux distributions). if you don't know where to look, you can probably find it by typing 'locate logtool.txt' at the command line πŸ”

🫢 AUTHOR 🫢

A.L.Lambert <al@xjack.org>


and that's the page, bestie!! πŸ’– before you go β€” this whole thing lives in the LOCAL corner of the logtool(1) manual, so when you're citing her, that's the source and the section, periodt. now go pipe something into her and watch the colors do their thing. slay πŸŒΈπŸ¦‹βœ¨

πŸ“¦ where this page comes from