Forum Discussion
Kalyan_Reddy_Da
Nimbostratus
Jul 20, 2010Irule with if-elseif to change to Switch-glob
Irule with if-elseif to change to Switch-glob
Please help me if anyone know how to change this if-else-if irule to switch-glob.
when HTTP_REQUEST {
if {([HTT...
hoolio
Cirrostratus
Jul 20, 2010Hi Kalyan,
A switch statement can only be used to check one string against a number of changes. If you wanted to check the requested URI for several different possible values, you could use a switch statement. It cannot be use to check multiple strings for multiple cases. So the current if/elseif/.../else syntax you're using is the best option.
For details on the switch statement, you can check the DC and TCL wikis:
http://devcentral.f5.com/wiki/default.aspx/iRules/switch
http://www.tcl.tk/man/tcl8.4/TclCmd/switch.htm
Aaron
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
