Forum Discussion

Graziano_Rizzat's avatar
Graziano_Rizzat
Historic F5 Account
Nov 26, 2007

issue to match datagroup string value with URI variable

Hello,

 

 

The irule we are working on is a simple redirect to https when there is a match between uri user request and string on data group.

 

 

Unfortunatly something on the matching statement is wrong because there isn't a match even if the user uri request is the same as the datagroup string. Here is the irule:

 

 

class urilist {

 

"/px/"

 

}

 

 

rule test-plugin {

 

when HTTP_REQUEST {

 

log local0. "requested host is [HTTP::host] uri starts with [HTTP::uri]"

 

if { [HTTP::uri] starts_with $::urilist}{

 

HTTP::redirect "https://[HTTP::host][HTTP::uri]"

 

}

 

else {

 

log local0. "requested uri is not into the datagroup [HTTP::uri]"

 

log local0. $::urilist

 

pool pool-www.farm

 

}

 

}

 

}

 

 

Log messages when user ask for /ag/ uri:

 

 

Nov 26 17:47:59 bigip1 tmm[1095]: Rule test-plugin : requested host is test.www.farm.csebo.it uri starts with /ag/

 

Nov 26 17:47:59 bigip1 tmm[1095]: Rule test-plugin : requested uri is not into the datagroup /ag/

 

Nov 26 17:47:59 bigip1 tmm[1095]: Rule test-plugin : {/px/}

 

 

Log messages when user ask for /px/ uri:

 

 

Nov 26 17:48:04 bigip1 tmm[1095]: Rule test-plugin : requested host is test.www.farm.csebo.it uri starts with /px/

 

Nov 26 17:48:04 bigip1 tmm[1095]: Rule test-plugin : requested uri is not into the datagroup /px/

 

Nov 26 17:48:04 bigip1 tmm[1095]: Rule test-plugin : {/px/}

 

 

 

Your help will be appreciated

 

 

Thanks

 

3 Replies

No RepliesBe the first to reply