Forum Discussion
m_137079
Nimbostratus
Mar 06, 2014Getting 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
- Kevin_Stewart
Employee
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 }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects