Forum Discussion

jay_41157's avatar
jay_41157
Icon for Nimbostratus rankNimbostratus
Sep 05, 2008

trying to use a wildcard in datagroup for use in irule

Hi,

 

 

I am trying to use a wild card in the datagroup below. the requirements are:

 

 

/cen

 

/cen/* <-- i need for this * to be a wild card so I can use the 1st irule below:

 

 

------------------------------------------------------------

 

IRULE1

 

------------------------------------------------------------

 

when HTTP_REQUEST {

 

if { (not [matchclass [string tolower [HTTP::uri]] starts_with $::LegacyExceptions])

 

and ([matchclass [string tolower [HTTP::uri]] equals $::LegacyPaths] ) } {

 

 

checked for matchclass != exceptions and == LegacyPaths and forward to Legacy_http_pool

 

log local0. "*****DEBUG SNAT applied [HTTP::uri]"

 

 

snat 172.23.0.60

 

pool dev_http_pool

 

 

HTTP::redirect http://www.google.com

 

pool Legacy_http_pool

 

} else {

 

when uri matches admin in Literatum check for source ip

 

if { [HTTP::uri] starts_with "/admin"

 

and (not [matchclass [IP::remote_addr] equals $::atyponAdmin]) } {

 

Literatum path for admin uri but not internal IP

 

log local0. "External IP ([IP::remote_addr]) attempting to access admin path ([HTTP::uri])"

 

HTTP::redirect http://pubs.acs.org/404.html

 

} else {

 

log local0. "*****DEBUG in else part of literatum"

 

pool Stage_http_pool

 

}

 

}

 

}

 

 

------------------------------------------------------------

 

IRULE2

 

------------------------------------------------------------

 

when HTTP_REQUEST {

 

if { (not [matchclass [string tolower [HTTP::uri]] starts_with $::LegacyExceptions])

 

and ([matchclass [string tolower [HTTP::uri]] starts_with $::LegacyPaths] or [matchclass [string tolower [HTTP::uri]] equals $::LegacyEquals] ) } {

 

checked for matchclass != exceptions and == LegacyPaths and forward to Legacy_http_pool

 

log local0. "*****DEBUG SNAT applied [HTTP::uri]"

 

 

snat 172.23.0.60

 

pool dev_http_pool

 

 

HTTP::redirect http://www.google.com

 

pool Legacy_http_pool

 

} else {

 

when uri matches admin in Literatum check for source ip

 

if { [HTTP::uri] starts_with "/admin"

 

and (not [matchclass [IP::remote_addr] equals $::atyponAdmin]) } {

 

Literatum path for admin uri but not internal IP

 

log local0. "External IP ([IP::remote_addr]) attempting to access admin path ([HTTP::uri])"

 

HTTP::redirect http://pubs.acs.org/404.html

 

} else {

 

log local0. "*****DEBUG in else part of literatum"

 

pool Stage_http_pool

 

}

 

}

 

}