Once a geek, forever a geek…

Sort web server logs to find top users

| 0 comments

Sometimes there is a very quick need to determine what user(s) are causing high load to a particular page. Instead of tailing high-speed logs and giving yourself a headache, Throw in a one-lined piped cat command to give you the info you’re after without the foreplay.
cat /path/to/access.log | awk '{print $1}' | sort | uniq -c | sort -n | tail

Related Posts

Author: Marius Voila

Hi! My name is Marius Voila, and I am a professional system administrator, system architect, and designer.

Leave a Reply

Required fields are marked *.

*