Forum Discussion
Ian_Upton_39258
Nimbostratus
May 30, 2008iRule Context
Gentlefolk,
I created a simple iRule "been Here" just to indicate what client had been through the VS which had the iRule "Been Here" configured.
Was simply:
when HTTP_REQUEST {
log local0. "Been Here URI = [HTTP::uri] [IP::client_addr] [IP::server_addr]"
Worked OK for a day or so but then for no reason I can fathom commenced failing reporting an error on server_addr "no session/connection open"
Is there a context issue?? I thought there were no profile/context issues for IP.
Any suggestions how I could protect such a irule against a catistrophic failure which killed all transactions?
Ian
- Philippe_CLOUP
Employee
Because we are doing "delay binding" (storing packets to analyze the Request, before choosing the destination node to LoadBalance to), the server may not be selected when you try to log the server IP. - hoolio
Cirrostratus
Phil's right about the delayed binding. If you add an HTTP profile to the virtual server, the BIG-IP will parse the HTTP headers before establishing a server side connection. I don't think the server side context will ever be established in the HTTP_REQUEST event, so there probably isn't much use in checking to see if the server address exists in HTTP_REQUEST. For some details on event context, you can check this post (Click here).when HTTP_REQUEST { set http_request_time [clock clicks -milliseconds] set request_line " [IP::remote_addr],\ [HTTP::method],\ [HTTP::version],\ [HTTP::host],\ \"[HTTP::uri]\",\ \"[HTTP::header value Referer]\", \"[HTTP::header User-Agent]\",\ ] } when HTTP_RESPONSE { set http_response_time [ clock clicks -milliseconds ] log local0. "$request_log_line,\ [HTTP::status],\ [HTTP::payload length],\ [expr $http_response_time - $http_request_time]" }
- Philippe_CLOUP
Employee
Hi aaron, - JRahm
Admin
I appreciate both responses, as this gives the original poster, iupton, options to solve his problem and additional knowledge base for future projects. - Colin_Walker_12Historic F5 AccountI'll have to go check, but I'm pretty sure they made some drastic improvements to that, semi-recently.
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