Forum Discussion

Harki_35330's avatar
Harki_35330
Icon for Nimbostratus rankNimbostratus
May 13, 2008

Underscore in URI causing problems?

 

 

I have a simple iRule as below but it is not working. I checked the URI in the logs and it is: /2076_PHX/configws.asmx

 

 

However it is not going to the correct pool. I have tried escapign the underscore too as below. Any ideas whats happening here?

 

 

when HTTP_REQUEST {

 

 

set DEBUG 2

 

if { $DEBUG > 1 } { log local0. "Request: [URI::decode [HTTP::uri]] " }

 

 

if {[string tolower [HTTP::uri]] contains "2076\_PHX/" }

 

{ if { $DEBUG > 1 } { log local0. "Sending request to XM Prod pool" }

 

pool p_2076_XM_PROD

 

} elseif {[string tolower [HTTP::uri]] contains "2076\_ST1/" }

 

{ if { $DEBUG > 1 } { log local0. "Sending request to XM stag pool" }

 

pool p_XM_STG

 

} elseif {[string tolower [HTTP::uri]] contains "2076/PHXAssembly" }

 

{ log local0. "Sending request to assembly _pool"

 

pool p_XM_Assembly

 

} elseif {[string tolower [HTTP::uri]] contains "2076\_dashprod/" }

 

{ if { $DEBUG > 1 } { log local0. "Sending request to dashboard pool" }

 

pool p_2076_XM_Dashboard

 

}

 

}
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    You shouldn't need to escape the underscore in the contains statement. When you say it's not going to the correct pool, what do you mean? What exactly is happening?

     

     

    Have you tried adding a log statement inside the if block that you expect it to enter with the URI in question? This would allow you to see if the if comparison is failing, or if it's an issue with the pool selection.

     

     

    Colin
  •  

    Sorry about the above post. As you can see the URI is being converted to lowecase but the literal string for comparison is upper case. DUH!!!

     

     

    {[string tolower [HTTP::uri]] contains "2076\_PHX/" }