Skip to content

Instantly share code, notes, and snippets.

@kawaz
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kawaz/ffdc37d7de3a8999f528 to your computer and use it in GitHub Desktop.
Save kawaz/ffdc37d7de3a8999f528 to your computer and use it in GitHub Desktop.
1時間のログ収集用1次スクリプト
#!/bin/bash
cat /var/www/prd/logs/access_log |
egrep '15/Oct/2014:(22:[345]|23:[012])' |
perl -pe's/ .*?2014:/ /;s/ .0900.*" "/ /;s/".*//;s/ /_/g;s/(.+?)_(.+?)_/$1 $2 /' > /tmp/ip-time-ua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment