Forum Discussion

Bob_Vance_75936's avatar
Bob_Vance_75936
Icon for Altostratus rankAltostratus
Nov 06, 2008

4.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

  • I think I found my answer here:

     

     

    http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=120
  • 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