Forum Discussion

rb1980_75708's avatar
rb1980_75708
Icon for Nimbostratus rankNimbostratus
Apr 01, 2009

Logging "Custom Request Information" in WA access logs

I have a situation where there is another proxy (in this case Akamai) that sits in front of WA, so in the access logs on WA I end up seeing the proxy IP as "Client IP Address". This is technically correct, but since the proxy (Akamai) sends the original client IP in an X-Forwarded-For header, I would like to add that to the log as well.

 

Since documentation on creating custom logging formats is sparse, I constructed the table below to help me. I assume I will need to use the listed "%X" option, but I cannot find any way to make it work.

 

I Tried:

 

%X-Forwarded-For

 

%XX-Forwaded-For

 

%XXX-Forwarded-For

 

%X "X-Forwarded-For"

 

and various other iterations, but none of them produce the desired result (just log "-")

 

Is this possible? How?

 

 

Custom Logging Symbols

 

 

>Request

 

%a - Client IP Address

 

%C - Cookie Data

 

%r - First Line of Request

 

%B - Hostname/IP of Origin Server

 

%v - Hostname/IP in HTTP Header

 

%m - Method

 

%c - Object Type

 

%F - Path

 

%p - Port

 

%P - Protocol

 

%Q - Query String

 

%R - Referer

 

%A - User Agent

 

%I - URL

 

 

>TIME OF REQUEST

 

%t - Timestamp

 

%D - Day (e.g. 01)

 

%M - Month (e.g. 01)

 

%V - Abbr. Month Name (e.g. Jan)

 

%Y - Year (e.g. 2001)

 

%G - Time (hh:mm:ss)

 

%z - Time Zone Offset

 

%Z - Time Zone Name

 

%X - Custom Request Information

 

 

>Response

 

%b - Bytes Written

 

%w - Cache Action

 

%d - Hostname/IP of Accelerator

 

%s - Response Code to Client

 

%x - Response Code from Origin

 

%y - Response Code from WA

 

 

>TIME TO PROCESS REQUEST

 

%E - in microseconds

 

%e - in milliseconds

 

%T - in seconds

 

%g - Time of Response (timestamp)

 

 

>Debugging

 

%n - Request Type Node Matched

 

 

No RepliesBe the first to reply