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:
...
Philippe_CLOUP
Employee
May 30, 2008Because 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.
If you want your iRule to work, it is better to do that in a different way.
HTTP_REQUEST will fire for each request.
IP::server_addr will exist only when the server TCP connection is established.
Use the event:
SERVER_CONNECTED, to store a local variable for the TCP connection.
when SERVER_CONNECTED{
set SRV_ADDR [IP::server_addr]
}
in the HTTP_REQUEST event, look if the local variable for the TCP connection bound to the HTTP request is popuplated.
when HTTP_REQUEST{
if {[info exists SRV_ADDR]}
{
log local0. " Been Here URI = [HTTP::uri] [IP::client_addr] $SRV_ADDR"
}
else
{
log local0. " Been Here URI = [HTTP::uri] [IP::client_addr] - First Request int this TCP connection - Server not yet selected"
}
}
Regards
/Phil
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