Forum Discussion

Pat_Fiorino_287's avatar
Pat_Fiorino_287
Historic F5 Account
Apr 19, 2007

Apache style logging on BIG-IP

I am trying to implement logging on BIG-IP similar to an Apache Custom Log::

 

 

 

CustomLog /opt/apache/logs/ssl_request_log "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %{JSESSIONID}C %{SSL_PROTOCOL}x %{SSL_CIPHER}x %D"

 

 

Here is a list restating the same:

 

- Time of request

 

- Duration of request in milliseconds, or nanoseconds

 

- HTTP response code (200, 302, 404, 500, etc)

 

- Response size in bytes

 

- URL accessed

 

- IP address of client

 

- Agent string of browser

 

- SSL protocol used

 

- SSL encryption algorithm used

 

- HTTP method (GET, POST, etc)

 

- HTTP protocol (HTTP 1.0, HTTP 1.1)

 

- Referrer URL

 

- Value of JSESSIONID client cookie

 

 

Ultimately we will use an external log server.

 

 

I came up with the following for testing:

 

 

when HTTP_REQUEST {

 

log local0. "Client IP: [IP::remote_addr], requesting: [HTTP::method]/[HTTP::host][HTTP::uri], browser: [HTTP::header User-Agent], Referer: [HTTP::header exists Referer], HTTP version [HTTP::version], JSESSION Cookie: [HTTP::cookie exists JSESSIONID], SSL: [SSL::cipher name]/[SSL::cipher version]/[SSL::cipher bits]"

 

}

 

 

when HTTP_RESPONSE {

 

log local0. "HTTP status: [HTTP::status], Response Size: [HTTP::payload length]"

 

}

 

 

 

Is there an easy way to log Duration of Request?

2 Replies

  • use the TCL clock command in the HTTP_REQUEST and HTTP_RESPONSE events and diff the two values.
  • For an example of how to do this, check out my recent tech tip on custom reporting with iRules.

     

     

    http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=66

     

    Click here

     

     

     

    -Joe