Skip to content

Instantly share code, notes, and snippets.

@brokendish
Created August 24, 2012 11:18
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 brokendish/3449328 to your computer and use it in GitHub Desktop.
Save brokendish/3449328 to your computer and use it in GitHub Desktop.
ホスト名を指定してシェルを実行→Apacheアクセスログからどのページにアクセスをしたかを表示する。
#!/bin/bash
dig $1 +noall +answer |
awk '{print($5)}'|
xargs -I{} grep {} /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