For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

m_137079's avatar
m_137079
Icon for Nimbostratus rankNimbostratus
Mar 06, 2014

Getting all the response headers without using a loop

I need to log all the response headers we are sending back to the customer and would like to know if there exists an option like [HTTP::request] for the response. Any input is much appreciated

Present Irule

when HTTP_REQUEST {

 set HttpHeader "\r\n" 
 set now [clock format [clock seconds] -format "%D %H:%M:%S %z"]  
 set request "<190>\r\n[HTTP::request]HttpKalive:[HTTP::is_keepalive]\r\nHttpVer:[HTTP::version]\r\nF5Addr:[IP::local_addr]\r\nClientIP:[IP::client_addr]\r\nTime:$now\r\nPort:$ClientPort\r\nServer:[LB::server addr]\r\n"

}

when HTTP_RESPONSE {
    
    TBD
}

when CLIENT_ACCEPTED {

   set applayer_hsl [HSL::open -proto UDP -pool hsl_8080_pool]     
   set ClientPort [TCP::local_port]

}

1 Reply

  • Sadly there is no HTTP::response command. The best way to get this data, in my opinion, is with a TCP event:

    when SERVER_CONNECTED {
        TCP::collect
    }
    when SERVER_DATA {
        set resp_headers [findstr [TCP::payload] "" 0 "\r\n\r\n"]
        log local0. $resp_headers
        TCP::release
    }