Forum Discussion
john_waterworth
Nimbostratus
Oct 06, 2010consolidate multiple irules in to one irule
is possible to consolidate the following irules into one rule ?
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "/mtp/" } {
drop
}
}
...
hoolio
Cirrostratus
Oct 07, 2010Hi 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
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
