Skip to content

Instantly share code, notes, and snippets.

@u1tnk
Created March 8, 2011 04:57
Show Gist options
  • Save u1tnk/859862 to your computer and use it in GitHub Desktop.
Save u1tnk/859862 to your computer and use it in GitHub Desktop.
apacheのログを時間単位でカウント。ログフォーマットにもよるけど。
cat hoge.log | awk '{print $5}' | cut -c 14-15 | sort | uniq -c
#awkは無条件で5番目を出力
#cut は14から15文字目
#sortはuniqueが前後しかunique化しないから必要。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment