Cookie information in log file

Hi everyone,

Hopefully someone here can help me with an issue I am currently facing
regarding logging in nginx.

We have a customer who uses Google Urchin, the commercial version of
Google analytics. This tracker needs the cookie information in the last
field of any given line in the log file. Apparently Apache is able to
put that information in there from what the Google Urchin help pages
say:
https://secure.urchin.com/helpwiki/en/UTM_Quick-Install_(Apache)?highlight=(utm)

At the moment I am using the following log format for our nginx servers:
log_format main
'$remote_addr - $remote_user [$time_local] ’
'"$request" $status $body_bytes_sent ’
'"$http_referer" “$http_user_agent” ’
‘"$http_x_forwarded_for"’;

In the wiki on codemongers I couldn’t find something regarding this
cookie information and also Google wasn’t very helpful.

Is there something like $http_cookie which I could simply append to my
current log format that would bring the same functionality as the log
format Google describes for Apache?

Thank you in advance for any hints.

Sebastian

Hello!

On Thu, Jun 19, 2008 at 10:05:50AM +0200, Sebastian Geib wrote:

https://secure.urchin.com/helpwiki/en/UTM_Quick-Install_(Apache)?highlight=(utm)

Is there something like $http_cookie which I could simply append to my
current log format that would bring the same functionality as the log
format Google describes for Apache?

http://wiki.codemongers.com/NginxHttpCoreModule#variables

All http headers have their $http_* counterparts, and $http_cookie is
here too.

Maxim D.

Hi Maxim,

Maxim D. schrieb:

Is there something like $http_cookie which I could simply append to
my current log format that would bring the same functionality as the
log format Google describes for Apache?

http://wiki.codemongers.com/NginxHttpCoreModule#variables

All http headers have their $http_* counterparts, and $http_cookie is
here too.
Thank you for you fast response. Apparently I was looking in the wrong
place. Now that looks much better in the log files.

Sebastian

This is the log format we using with our urchin 6 setup

log_format urchin ‘$remote_addr $http_host - [$time_local] “$request”
$status $body_bytes_sent “$http_referer” “$http_user_agent”
“$http_cookie”’;

Cheers

Dave