Skip to content

Instantly share code, notes, and snippets.

@elhoyos
Last active May 6, 2017 16:49
Show Gist options
  • Save elhoyos/2f3d762a3d446716bc6bac6f51746d5f to your computer and use it in GitHub Desktop.
Save elhoyos/2f3d762a3d446716bc6bac6f51746d5f to your computer and use it in GitHub Desktop.
Print useful SEO info from webserver logs
# Given a log file with entries of the following form:
# 2017-05-06T16:42:54.392Z 66.249.64.58 200 GET /path/to-somewhere 27.020 ms - - "-"
# Print all slow Google bot requests
tail -f web-server.log | awk '{ip=$2; status=$3; time=$6; path=$5; if (ip ~ /66\.249\.64/ && time > 150) print time " (" status ") " path}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment