1. Get access to the top 10 IP addresses
Cat Access.log|awk ' {print '} ' |sort|uniq-c|sort-nr|head-10
2. Most visited files or pages, take the top ten
Cat Access.log|awk ' {print $11} ' |sort|uniq-c|sort-nr|head-10
3. List the maximum number of EXE files transmitted
Cat Access.log |awk ' ($7~/\.exe/) {print $ "" $ "" $4 "" $7} ' |sort-nr|head-20
4. List exe files with output greater than 300000byte (approx. 300kb) and the number of corresponding file occurrences
Cat Access.log |awk ' ($ > 300000 && $7~/\.exe/) {print $7} ' |sort-n|uniq-c|sort-nr|head-100
5. List the most time-consuming pages to the client
Cat Access.log |awk ' ($7~/\.php/) {print $NF "" $ "" $4 "" $7} ' |sort-nr|head-100
6. List the most time-consuming pages (more than 60 seconds) and the number of corresponding page occurrences
Cat Access.log |awk ' ($NF > && $7~/\.php/) {print $7} ' |sort-n|uniq-c|sort-nr|head-100
7. List files that have been transmitted for longer than 30 seconds
Cat Access.log |awk ' ($NF >) {print $7} ' |sort-n|uniq-c|sort-nr|head-20
8. Statistics website Traffic (G)
Cat Access.log |awk ' {sum+=$10} END {print sum/1024/1024/1024} '
9. Statistics 404 of the connection
awk ' ($9 ~/404/) ' Access.log | awk ' {print $9,$7} ' | Sort
10. Statistics HTTP Status
Cat Access.log |awk ' {print $9} ' |sort|uniq-c|sort-rn
This article is from the "Practical Linux knowledge and Skills sharing" blog, please be sure to keep this source http://superleedo.blog.51cto.com/12164670/1886254
Linux Apache Log Analysis--commands