Forum Discussion
daemien_139983
Jun 13, 2014Nimbostratus
irule redirect and switch -glob
Hey guys - trying to setup irule so we can redriect uri to servers. how can i add the switch -glob in to this irules - or is there a better way of d0ing this? Code when HTTP_REQUEST {
if { ...
- Jun 13, 2014
I gather you are trying to use partial matching with the -glob option. Try this...
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/filetransfer*" { pool "mix_prod_v1_filetransfer" } "*/view.net" { pool "mix_prod_v1_view" } "*/webimagedownloader/*" { pool "mix_prod_v1_webimage" } default { pool "mix2prod.test_pool" } } }
I've included all three type of pattern matching. Adjust as needed.
item* -- starts with item *item -- ends with item *item* -- contains item
Kevin_Davies_40
Nacreous
I gather you are trying to use partial matching with the -glob option. Try this...
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/filetransfer*" { pool "mix_prod_v1_filetransfer" }
"*/view.net" { pool "mix_prod_v1_view" }
"*/webimagedownloader/*" { pool "mix_prod_v1_webimage" }
default { pool "mix2prod.test_pool" }
}
}
I've included all three type of pattern matching. Adjust as needed.
item* -- starts with item
*item -- ends with item
*item* -- contains item
The_Bhattman_16
Jun 13, 2014Nimbostratus
Remember "-glob" switch allows the use of starts_with, ends_with, and contains.
-=Bhattman=-
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