Forum Discussion
Roger_Grannum_7
Nimbostratus
Apr 06, 2006Newbie 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
Apr 06, 2006Historic 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_httpsHelp 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
