Skip to content

Instantly share code, notes, and snippets.

@brokendish
Created February 25, 2012 08:50
Show Gist options
  • Save brokendish/1907396 to your computer and use it in GitHub Desktop.
Save brokendish/1907396 to your computer and use it in GitHub Desktop.
ホスト名からApacheログの調査をする
#!/bin/bash
grep `dig $1|grep -A 1 'ANSWER SECTION'|tail -1|awk '{print($5)}'` /var/log/apache2/access_all.log |
awk 'BEGIN{FS="\""}{print $2}' |
sort |
uniq |
egrep -v "対象外文字1|対象外文字2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment