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.
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