Thứ Sáu, 9 tháng 12, 2016

Troubleshoot with Apache Logs

$ cat access.log | cut -d ' ' -f 9 | sort | uniq -c | sort -nr
     941 200
     292 500
     290 404
     50 401
     20 400

$ grep " 404 " access.log | cut -d ' ' -f 7 | sort | uniq -c | sort -nr
     17 /manager/html
      3 /robots.txt
      3 /phpMyAdmin/scripts/setup.php
      3 //myadmin/scripts/setup.php
      3 /favicon.ico

$ cat access.log.1 | cut -d '"' -f 6 | sort | uniq -c | sort -nr

     51 -
     47 ZmEu
     31 () { :;};/usr/bin/perl -e 'print
     14 Apache/2.2.22 (Ubuntu) (internal dummy connection)
     11 Mozilla/5.0

$cat access.log | cut -d ' ' -f 1 | sort | uniq -c | sort -nr
     31 91.142.209.68
     29 94.102.49.11
     28 173.236.125.26
     19 222.74.212.77
     14 127.0.0.1
362935

$cat access.log.1 | cut -d ' ' -f 1 | sort | uniq -c | sort -nr
     31 91.142.219.68
     29 94.102.49.11
     28 173.236.125.26
     19 222.74.212.77
     14 127.0.0.1

Không có nhận xét nào:

Đăng nhận xét