Forum Discussion
qliang_231469
Nimbostratus
Sep 10, 2018Get URI and Direct to the pool with part of the URI number
Hi Pros,
I have a questions, I have a irule
like this
set uri_info [string tolower [HTTP::uri]]
switch -glob $uri_info {
"/sj-01/"
{pool marketing-lead-01 }
"/sj-02/"
{pool marketing...
jaikumar_f5
Noctilucent
Sep 10, 2018Something like below, haven't tested.
when HTTP_REQUEST {
set variable ""
set variable [getfield [getfield [HTTP::uri] "/sj-" 2] "/" 1]
here variable would have 01 or 02 ....
Check if the pools exists first with the variable using catch command, example marketing-lead-01 does exists or not
if [ catch { pool "marketing-lead-$variable" } ] {
log local0. "URI contain /sj-$variable/ - pool assigned is marketing-lead-$variable"
pool marketing-lead-$variable
} else {
pool marketing-lead-default-pool
}
}
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