1
0

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のアクセスログからURLごと、時間帯別でURLごとにアクセスを集計する

1
Posted at

パラメータを除外し、URLごとに集計

cat access.log | awk -F\" '{print $2}' | awk -F' ' '{print $2}' | cut -f1 -d? | sort | uniq -c | sort -n -r > output.txt

時間帯のURLごとに集計

例) 2016/04/27/ 18:00 台の時間帯にアクセスのあったURLごとの集計

cat access.log | grep '\[27/Apr/2016:18:00:' | awk -F\" '{print $2}' | awk -F' ' '{print $2}' | cut -f1 -d? | sort | uniq -c | sort -n -r > output_1800.txt

その他

複数あるアクセスログファイルを1つにまとめる

cat access1.log access2.log access3.log > total_access.log
1
0
0

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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?