Find the most common processes in a log file with Bash

PHOTO EMBED

Sun Mar 28 2021 10:01:51 GMT+0000 (Coordinated Universal Time)

Saved by @FlorianC #bash

#!/bin/bash

for logfile in /var/log/*log; do
	echo "Processing: $logfile"
    # the following line splits the logfile entry line with an empty space as delimiter and then keeps only everything from field five onwards
    cut -d" " -f5- $logfile | sort | uniq -c | sort -nr | head -5
done
content_copyCOPY