Skip to content

Instantly share code, notes, and snippets.

@vjt
Created February 22, 2012 15:32
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vjt/1885569 to your computer and use it in GitHub Desktop.
Save vjt/1885569 to your computer and use it in GitHub Desktop.
GRC (Generic Colouriser/Colorizer) configuration for Apache / nginx access logs
# Configuration suitable to display Apache/nginx access logs
# Based on conf.proftpd by Pavol Domin
# Crafted by Marcello Barnaba <vjt@openssl.it>
# Get GRC at http://kassiopeia.juls.savba.sk/~garabik/software/grc.html
#
# ip number
regexp=^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
colours=bold magenta
count=once
-
# everything in brackets
regexp=\[.+?\]
colours=cyan
count=once
-
# everything in ""
regexp=\".+?\"
colours=blue
count=more
-
# HTTP Method
regexp=(?:HEAD|GET|POST|PUT|DELETE)
colours=bold blue
count=once
-
# HTTP Path
regexp=\s/[^\s]+
colours=bold green
count=once
-
# HTTP OK Status codes - from http://httpcats.herokuapp.com/ ;-)
regexp=\s(?:10[01]|20[02467]|30[0123457])
colours=green
count=once
-
# HTTP Error status code - from the same source as above
regexp=\s(?:40[1-9]|41[1-8]|42[2-9]|431|444|450|50[2-9]|599)
colours=bold red
count=once
-
# Request byte size
regexp=\s(?!(?:10[01]|20[02467]|30[0123457])|(?:40[1-9]|41[1-8]|42[2-9]|431|444|450|50[2-9]|599))\d+
colours=yellow
count=once
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment