Skip to content

Instantly share code, notes, and snippets.

@jpetazzo
Created December 9, 2011 00:37
Show Gist options
  • Save jpetazzo/1449496 to your computer and use it in GitHub Desktop.
Save jpetazzo/1449496 to your computer and use it in GitHub Desktop.
# Find all minutes during which there was at least one "502" status code:
grep ' 502 ' http.log | awk '{print $4}' | cut -d: -f1-3 | uniq
# Find all minutes during which there were valid requests (excluding 502 and 400 status codes):
grep -v ' 502 ' http.log | grep -v ' 400 ' | awk '{print $4}' | cut -d: -f1-3 | uniq
# If you want hours instead of minutes, replace f1-3 by f1-2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment