Forum Discussion
naladar_65658
Altostratus
Nov 20, 2008A Problem with Datagroup Usage
I am having problems with an iRule that uses datagroups. For some reason it just doesn't seem to work at all. Would you fellas mind taking a look at it and maybe point out any grammatical or logic e...
hoolio
Cirrostratus
Nov 20, 2008If the URI's start with the datagroup members, then 'matchclass $header_uri starts_with $::dg_name' is the right format. Using []'s would try to execute the value of the URI, so that wouldn't work.
You can add logging to help determine what's happening:
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: New HTTP request to [HTTP::uri]"
set header_uri [string tolower [HTTP::uri]]
log local0. "[IP::client_addr]:[TCP::client_port]: \$header_uri: $header_uri"
if {[matchclass $header_uri starts_with $::www8_uri]} {
log local0. "[IP::client_addr]:[TCP::client_port]: Matched www8_uri dg"
pool WWW8_Pool
} elseif {[matchclass $header_uri starts_with $::oam_uri]} {
log local0. "[IP::client_addr]:[TCP::client_port]: Matched oam_uri dg"
HTTP::redirect "https://blank.blank.com/oam/main/oamMain.jsp"
...
} else {
log local0. "[IP::client_addr]:[TCP::client_port]: No match"
log local0. "[IP::client_addr]:[TCP::client_port]: dg's: \$::www8_uri: $::www8_uri, \$::oam_uri: $::oam_uri, etc"
pool WWW2_Pool
}
}
Aaron
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
