User Tools

Site Tools


wiki:tech:linux:logs_and_awk

Parse apache (or nginx) access logs rotation archive.

find access*.gz | xargs cat | gzip -d | awk '{split($4,a,/:/); print substr(a[1],2)}' | uniq -c
find access*.gz | xargs cat | gzip -d | awk '{split($4,a,/:/); print $1," ",substr(a[1],2)," ",$11}' | column -t
cat ./access_log.10.gz | gzip -d |  awk '{print $1," ",$4," ",$11}' | grep "17/Jul/2022" | less
wiki/tech/linux/logs_and_awk.txt · Last modified: 2022/08/08 01:02 by kpc

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki