Forum Discussion

rohitbarolia_28's avatar
rohitbarolia_28
Icon for Nimbostratus rankNimbostratus
May 03, 2017

Rule to log browser info.

I am looking for a rule to log browser info (type and version) on one of the https VIP (standard VIP).

 

  • P_K's avatar
    P_K
    Icon for Altostratus rankAltostratus

    This should work! Apply this to your virtual server along with any other irules.

     

    This iRule will log user-agent, client IP, host, requested uri, Xff, content-lenth, keep-alive, authorization(if any), etc..

     

    when HTTP_REQUEST {

     

    set LogStr "Client [IP::client_addr]:[TCP::client_port] -> [HTTP::host][HTTP::uri]"

     

    log local0. ""

     

    log local0. "$LogStr (request)"

     

    foreach aHeader [HTTP::header names] {

     

    log local0. "$aHeader: [HTTP::header value $aHeader]"

     

    }

     

    log local0. ""

     

    }

     

  • Snl's avatar
    Snl
    Icon for Cirrostratus rankCirrostratus

    in order to get true client ip you can use the http profile in that enable insert x-forwarder for