qliang_231469
Sep 11, 2018Nimbostratus
Get 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-lead-02} "/sj-03/*" {pool marketing-lead-03} ... default {pool marketing-lead-default-pool}
So every time, i will need to manually add the URI conditions when I have different URI serving different pool.
I wonder if any pros could help on my pool tclsh, how it could be done with something like this
switch -glob $uri_info { "/sj-$variable/" {pool marketing-lead-$variable } if no "/sj-/*" match, then go to default pool
i appreciate anyone could give me some light on the syntax for the tclsh irule.
Thanks.