Forum Discussion
Roger_Grannum_7
Nimbostratus
19 years agoNewbie Question
First crack at this and I can't seem to get it right. I want to be able to check the URI coming in and based on the variable at the end determine which pool the request goes to.
For example: ...
Martin_Machacek
19 years agoHistoric F5 Account
Roger,
first of all, it is generally better (read faster) to use the "equals", "starts_with", "contains" and "ends_with" operators instead of "matches_regex" unless you really need the full power of regular expressions. In you particular case I'd suggest to use:
if(http_uri contains "NewOrder") {
use pool Idg_NewOrder_https
} else {
use pool idg_443
}It is impossible to tell what is failing from the data you've provided. I'd guess that your problem is in the matches_regex expression but I can't tell for sure, since you've not provided the URI that you've used to test your rule neither have you descibed what was the observed behavior.
In order to troubleshoot the problem, you can add log statements to your rule like this:
rule r1 {
log "uri: " + http_uri
if(http_uri contains "NewOrder") {
use pool Idg_NewOrder_https
log "using pool Idg_NewOrder_https"
} else {
use pool idg_443
log "using pool idg_443"
}
}You'll receive following log entries in /var/log/bigip when the rule gets executed:
RULE r1 - uri: NewOrder.asp?From=IDGC
RULE r1 - using pool Idg_NewOrder_https