Skip to content

Instantly share code, notes, and snippets.

@beunwa
Last active August 29, 2015 14:06
Show Gist options
  • Save beunwa/af45c453ce128e97f39c to your computer and use it in GitHub Desktop.
Save beunwa/af45c453ce128e97f39c to your computer and use it in GitHub Desktop.
extract des visites google depuis les logs apache et le transforme en csv
awk '{if($14 ~ /Googlebot/) {print $7}}' apache.log | sort | uniq -c | sort -n | tail -40 | sed 's/^[ \t]*//;s/[ \t]*$//' > top40google.csv
more apache.log | grep Googlebot | awk {'split($4, a, ":"); split(a[1], a, "["); print a[2]'} | sort | uniq -c | sed 's/^[ \t]*//;s/[ \t]*$//' > google-visits-per_day.csv
more apache.log | grep Googlebot | awk {'print $7'} | sort | uniq -c | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment