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:
...
hoolio
Cirrostratus
May 30, 2008Phil'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).
Were you logging the virtual server IP in HTTP_REQUEST? That would always be available in the client side context using IP::local_addr.
If you want to log which server the connection was made with, you can just log the details in the SERVER_CONNECTED event. You'll need to save the HTTP::uri in the HTTP_REQUEST event as it's not available anymore in the SERVER_CONNECTED event. Here's an example based off of this codeshare entry (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]"
}
Aaron
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