Forum Discussion
hooleylist
Oct 07, 2010Cirrostratus
Hi John,
You'll get a lot more views if you post to the main iRules forum here:
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/afv/topicsview/aff/5/asg/50/Default.aspx
Yes, you can combine all of those iRules into one using a more efficient switch statement. For details on using switch, you can check this article:
http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/244/Switch-Gone-Wild-Using-Wildcards-with-the-Tcl-switch-command.aspx
and the switch wiki page:
http://devcentral.f5.com/wiki/default.aspx/iRules/switch
when HTTP_REQUEST {
Check the requested URI, set to lower case with wildcards
switch -glob [string tolower [HTTP::uri]] {
"*/mtp/*" -
"*/console/*" -
"*/mtpadm/*" -
"*/remote-deploy/*" -
"*/juddi/*" -
"*/activeemg/*" -
"*/console-base/*" -
"*/debug-views/*" -
"*/plan-creator/*" -
"*/monitoring/*" -
"*/plugin/*" -
"*/system-database/*" {
drop
}
}
}
Aaron