Skipping down to the answer section so that I can properly format the code.
OK, I get the jist of all of this but the first part isn't working, only the else is working... Can you see what I did wrong? I have /app1:=Windows2008Pool defined in my_uri_dg when HTTP_REQUEST { if { [class match [string tolower [HTTP::uri]] starts_with my_uri_dg]} { pool [class match -value [string tolower [HTTP::uri]] starts_with my_uri_dg] } else {pool Windows2003 } }
Since the else is working, that leads me to believe the condition isn't being met. Throw in some logging:
HTTP_REQUEST {
log local0. "Original URI = [HTTP::uri]"
if { [class match [string tolower [HTTP::uri]] starts_with my_uri_dg] } {
log local0. "URI matches datagroup"
pool [class match -value [string tolower [HTTP::uri]] starts_with my_uri_dg]
} else {
log local0. "URI doesn't match data group"
pool Windows2003
}
}
You can either tail the LTM log in the BIG-IP management shell:
tail -f /var/log/ltm
Or look at it in the GUI under System - Logs.