Forum Discussion
pedinopa_170325
Nimbostratus
Mar 07, 2016iRule to select specific pool member
I am writing an irule to select a specific pool node based or the uri string.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/node1" { node 80 }
...
Greg_Labelle
Nimbostratus
Mar 08, 2016I believe your problem is actually the "switch" command. That command does not accept wildcards for matching, you'll need to use a variable to pull the node number out of the uri before running your switch.
For example:
set node [substr [HTTP::uri] 0 "/"]
switch node {
"node1" {
pool MyPool member Member1 80
}
"node2" {
pool MyPool member Member2 80
}
default {
pool MyPool
}
}
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