Forum Discussion
Bob_Vance_75936
Altostratus
Nov 05, 20084.x to 9.x irule conversion
I'm a newbie with tcl and am having difficulty getting them over from 4.x to 9.4. It seems to balk at an "[undefined procedure sS] [sS]" in the regex statements. It does this at each one of the bracket expressions. What does this mean and how do I resolve it? Thanks in advance for your help.
when HTTP_REQUEST {
if { [http_uri] contains "^/[sS][cC](/.{0,}|$)" } {
use pool CSHTTP
}
elseif { [http_uri] contains "^/PlanSharedResourcesClient/.*" } {
use pool PlanResourcesPool
}
elseif { [http_uri] contains "^/PlanCentral/.*" } {
use pool PlanResourcesPool
}
elseif { [http_uri] contains ".*(\.htm|\.htc|\.js|\.gif|\.png|\.jpg|\.css)" } {
use pool PlanResourcesPool
}
elseif { [http_uri] contains "^/[nN][mM][fF](/.{0,}|$)" } {
use pool DOCPool
}
elseif { [http_uri] contains "^/[wW]eb[sS]ervices(/.{0,}|$)" } {
use pool WebServices
}
elseif { [http_uri] contains "^/[fF][sS](/.{0,}|$)" } {
use pool Feedback
}
else {
use pool NaviNetHTTP
}
}
2 Replies
- Bob_Vance_75936
Altostratus
I think I found my answer here:
http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=120 - Nicolas_Menant
Employee
Hi,
if you have more and more checking to do it may become more efficient to use the command switch instead.
other tips:
- Contains takes more CPU than starts_with and ends_with.
- Regular expression is taking a lot of cpu
So, in some of your statement you can remove the regular expression you specified by using those commands.
Those update will make it definitely faster
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