Forum Discussion
kridsana
Cirrocumulus
Apr 29, 2015Simplify irule (rather than if ,elseif, elseif ...)
Hi
Is there anyway to simplify or condense this irule?
when HTTP_REQUEST
if {[HTTP::uri] starts_with "/atm/"
or [HTTP::uri] contains "/ammcontent"
or [HTTP::uri] contains...
Brad_Parker
Cirrus
May 11, 2015For scale-ability in the future if you ever needed to send traffic to other pools I would recommend creating your string data group with the URIs you want to match with values for the corresponding pool and use an iRule like this. I would also recommend setting the default pool on the virtual server itself.
when HTTP_REQUEST {
if {[string tolower [HTTP::uri]] starts_with "/atm/"}{
pool atm_HTTP
}
elseif {[class match [string tolower [HTTP::uri]] contains "/Common/my_uri_datagroup"]}{
pool [class match -value [string tolower [HTTP::uri]] contains "/Common/my_uri_datagroup"]
}
}
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