Forum Discussion
Thomas_89706
Nimbostratus
May 17, 2007In need of some iRule HELP!! URI Path stuff.
I'm trying to take the first path in the URI and direct it to a specific pool if it contains a specific string. For some reason my iRule below is directing all traffic to my catch all pool even if it ...
JRahm
Admin
May 18, 2007You can build a class of your CSID's then reference your class for pool pl_1 inclusion:
class myCSID {
"b02181"
"h05527"
}
when HTTP_REQUEST {
set CSID [string tolower [URI::path [HTTP::uri] 1 1]]
if { [matchclass $CSID equals $::myCSID] } {
pool pl_1
} else {
pool pl_2
}
}If you ever had more pools, you could alter the class to include the pool reference, then use findclass to extract it:
class myCSID {
"b02181 pl_1"
"h05527 pl_1"
"x07770 pl_2"
"y07070 pl_3"
}
when HTTP_REQUEST {
set CSID [string tolower [URI::path [HTTP::uri] 1 1]]
if { [matchclass $CSID equals $::myCSID] } {
pool [findclass $CSID $::myCSID " "]
} else {
pool defaultPool
}
}HTH, std disclaimer....untested!
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