Skip to content

Instantly share code, notes, and snippets.

@adrianpike
Created September 15, 2010 19:30
Show Gist options
  • Save adrianpike/581300 to your computer and use it in GitHub Desktop.
Save adrianpike/581300 to your computer and use it in GitHub Desktop.
log_format metrics '$time_local $upstream_response_time $request_time $request_length $bytes_sent | "$request"';
access_log /var/log/nginx/traffic.log metrics;
access_log logs/access.log combined;
# Gives you stuff like this:
15/Sep/2010:15:28:35 -0400 0.087 0.087 1341 3619 | "GET /account HTTP/1.1"
15/Sep/2010:15:28:35 -0400 - 0.000 1315 158 | "GET /javascripts/jquery-1.4.1.min.js?1284497684 HTTP/1.1"
15/Sep/2010:15:28:35 -0400 - 0.000 1326 158 | "GET /javascripts/jquery.uploadify.v2.1.0.min.js?1284497684 HTTP/1.1"
15/Sep/2010:15:28:35 -0400 - 0.000 1308 158 | "GET /javascripts/swfobject.js?1284497684 HTTP/1.1"
15/Sep/2010:15:28:35 -0400 - 0.000 1303 158 | "GET /javascripts/base.js?1284497684 HTTP/1.1"
15/Sep/2010:15:28:36 -0400 - 0.000 1311 158 | "GET /javascripts/html5support.js?1284497684 HTTP/1.1"
15/Sep/2010:15:28:36 -0400 - 0.000 1311 158 | "GET /javascripts/panel-editor.js?1284497684 HTTP/1.1"
15/Sep/2010:15:28:36 -0400 - 0.000 1310 158 | "GET /javascripts/jquery.boxy.js?1284497684 HTTP/1.1"
15/Sep/2010:15:28:36 -0400 - 0.000 1324 158 | "GET /javascripts/jquery.qtip-1.0.0-rc3.min.js?1284497684 HTTP/1.1"
15/Sep/2010:15:28:36 -0400 - 0.000 1322 158 | "GET /javascripts/jquery.autocomplete.min.js?1284497684 HTTP/1.1"
15/Sep/2010:15:28:36 -0400 - 0.000 1310 158 | "GET /javascripts/validations.js?1284497684 HTTP/1.1"
15/Sep/2010:15:28:44 -0400 0.004 0.004 1283 407 | "GET / HTTP/1.1"
15/Sep/2010:15:28:44 -0400 0.040 0.040 1221 1476 | "GET /users/bar HTTP/1.1"
15/Sep/2010:15:28:54 -0400 0.043 0.043 109 6317 | "GET /user_session/new HTTP/1.0"
15/Sep/2010:15:28:58 -0400 0.060 0.060 1278 861 | "GET /users/bar HTTP/1.1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment