Forum Discussion
Robert_47833
Nov 14, 2011Altostratus
how to use switch to match datagroup
1:there is a datagroup:cjj
how to use switch to match this group
switch -glob [HTTP::path] {
"cjj" xxxx ???
2:
switch -glob [HTTP::path] { "*jpg" - "*bmp" - ...
Michael_Yates
Nov 14, 2011Nimbostratus
Hi jucao,
As Hoolio pointed out, if you are after efficiency then you can go with a switch statement over a Data Group. Some (myself included) view management of a Data Group easier to keep track of (and you can make modifications without having to alter your iRule).
You can so it with something like:
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::uri]] ends_with image_types ] } {
pool image_server_pool
}
else {
pool content_server_pool
}
}
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