Forum Discussion
peter_siman
Nimbostratus
May 29, 2011Pool selection based on URI string
Hi,
I have writtend a simple iRule to select particular pool based on what the URI string is. See below the iRule. Unfortunatelly, when applied a following messsages show up in logs.
...
Bob_10976
Nimbostratus
Jun 13, 2011Thanks everyone for the help with this rule, I found that I had an http class assoicated to the VIP that was overwritting the irule. Once I removed the http class it worked as expected, I guess sometimes it just those things you over look.
I did have one more follow up question though. My rule works when the path is matched but it appears that I may have to add another paths as well. How would I modify the rule so that it checks more than one path? I've copied the rule below so you can see what I have currently.
when HTTP_REQUEST {
log local0. "McBob request received [string tolower [HTTP::uri]] starts_with /mcbob"
if { [string tolower [HTTP::path]] starts_with "/mcbob" } {
log local0. "McBob request for service received. Selecting end server"
pool secure2.mydomain.com
}
else {
pool secure.mydomain.com
log local0. "Condition not matched. No WIN2K8 server selected."
}
}
when SERVER_CONNECTED {
log local0. "Connection from [IP::client_addr]:[TCP::client_port] to WIN2K8 server: [IP::server_addr]:[TCP::server_port] established."
}
Thanks again for everyone's input.
Bob
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