LOGTOP(1)

πŸ‘‘ LOGTOP β€” the manual, but make it slay

okay bestie, sit down, hydrate, because we're about to talk about logtop from the General Commands Manual and it's genuinely iconic. no cap. πŸ’…


✨ NAME ✨

logtop β€” Realtime log line rate analyser πŸ¦‹


🌸 SYNOPSIS 🌸

logtop [OPTIONS]

that's it. that's the whole vibe. you feed it stuff, it tells you things. periodt. ✨


πŸ’– DESCRIPTION πŸ’–

okay so logtop is a System Administrator tool that analyzes the line rate on stdin. the way it works is literally this: it reads on stdin and prints a constantly updated result, and that result shows up in columns, like so:

  • Line number πŸ”’
  • count πŸ”’
  • frequency πŸ”’
  • and the actual line πŸ“

and bestie, listen, this:

$ tail -f FILE | logtop

is the friendly version of this whole situation:

$ watch 'tail FILE | sort | uniq -c | sort -gr'

same energy, way less typing, way more main character. no cap. 🫢


πŸ’… OPTIONS πŸ’…

  • -s, --size=K β€” only keep K lines in memory, instead of the default 10000. memory said "i'm full" and we said "understood, queen." πŸŽ€
  • -q, --quiet β€” do not display a live view of the data, only display a top at exit. shy girlie mode. 🀫
  • -l, --line-by-line=K β€” print the result line by line, in a machine friendly format, and K is the number of results to print per line. yes this is for when a script is the one reading, not your eyeballs. πŸ€–

the line by line format is: [%d %f %s\t]*\n

  • %d : Number of occurences
  • %f : Frequency of apparition
  • %s : String (Control chars replaced by dots.)
note the typo in "occurences" is load-bearing, i'm keeping it exactly as the manual says, don't come for me πŸ’€
  • -i, --interval=K β€” interval between graphical updates, in seconds. Defaults to 1. so it refreshes once a second unless you tell it otherwise. ⏰
  • -h, --help β€” Show summary of options. your little safety net bestie. πŸ™ˆ
  • -v, --version β€” Show version of program. flex the version number. πŸ‘‘

🌈 EXAMPLES 🌈

Here are some logtop usage examples. grab a snack, this is the fun part. πŸ“

tail -f cache.log | grep -o "HIT\|MISS" | logtop

Realtime hit / miss ratio on some caching software log file. obsessed. ✨

tail -f access.log | cut -d' ' -f1 | logtop -s 10000

Realtime most querying IPs on your server, as long as log lines in access.log starts with the client IP. πŸ”₯

tail -f access.log | cut -d' ' -f7 | logtop -s 10000

Realtime most requested web pages in a NCSA like log file. the people have spoken and they want the same page over and over, iykyk. πŸ“„

cat auth.log | grep -v "CRON" | grep -o ": .*" | logtop -q -s 100000

Display a one-shot simple analyse of your auth.log. no live view, just the receipts at the end. πŸ’€


πŸ¦‹ SEE ALSO πŸ¦‹

go give it a lil visit, it's the ancestor of this whole thing. 🫢


πŸŽ€ AUTHOR πŸŽ€

logtop was written by Julien Palard. πŸ‘‘

This manual page was written by Julien Palard <julien@palard.fr>, for the Debian project (and may be used by others). so generous, so iconic. 🌸


and that's the whole page bestie! this was version LOGTOP(1), dated April 16, 2011 β€” yes it's an elder but she's still serving πŸ’…βœ¨ bye bye, go pipe something into it fr fr πŸŽ€πŸ’–

πŸ“¦ where this page comes from