Skip to content

Instantly share code, notes, and snippets.

@vmadman
Created April 27, 2013 06:59
Show Gist options
  • Select an option

  • Save vmadman/5472166 to your computer and use it in GitHub Desktop.

Select an option

Save vmadman/5472166 to your computer and use it in GitHub Desktop.

Revisions

  1. vmadman created this gist Apr 27, 2013.
    26 changes: 26 additions & 0 deletions apache-json-log-format
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    # Access Logs
    LogFormat "{ \
    \"@vips\":[\"%v\"], \
    \"@source\":\"%v%U%q\", \
    \"@source_host\": \"%v\", \
    \"@source_path\": \"%f\", \
    \"@tags\":[\"Apache\",\"Access\"], \
    \"@message\": \"%h %l %u %t \\\"%r\\\" %>s %b\", \
    \"@fields\": { \
    \"timestamp\": \"%{%Y-%m-%dT%H:%M:%S%z}t\", \
    \"clientip\": \"%a\", \
    \"duration\": %D, \
    \"status\": %>s, \
    \"request\": \"%U%q\", \
    \"urlpath\": \"%U\", \
    \"urlquery\": \"%q\", \
    \"method\": \"%m\", \
    \"referer\": \"%{Referer}i\", \
    \"user-agent\": \"%{User-agent}i\", \
    \"bytes\": %B \
    } \
    }" ls_apache_json


    # The catch-all
    CustomLog "||/usr/local/bin/udpclient.pl 127.0.0.1 5001" ls_apache_json