26
37

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Apache access_logログからのアクセス数集計方法

Last updated at Posted at 2016-12-18

アクセス元IP毎のアクセス数(Top30)

  • grep "日付" ログファイル名 | awk '{print $1}' | sort | uniq -c | sort -rn
    • 例) grep "18/Dec/2016" /var/log/httpd/access_log | awk '{print $1}' | sort | uniq -c | sort -rn

1時間毎のアクセス数(Top30)

  • grep "日付" ログファイル名 | awk '{print $4}' | cut -b 2-15 | sort | uniq -c | sort -rn
    • 例) grep "18/Dec/2016" /var/log/httpd/access_log | awk '{print $4}' | cut -b 2-15 | sort | uniq -c

アクセス先URL毎のアクセス数(Top30)

  • grep "日付" ログファイル名 | awk '{print $7}' | sort | uniq -c | sort -rn
    • 例) grep "18/Dec/2016" /var/log/httpd/access_log | awk '{print $7}' | sort | uniq -c | sort -rn

補足

  • リアルタイムのアクセス数集計方法はこちら
    • netstat -pantu | grep -e ':80' -e ':443' | awk '{print $6}' | sort | uniq -c
26
37
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
26
37

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?