Forum Discussion
geffryti_32102
Nimbostratus
Mar 17, 2010how to use data group
Requirements:
1. system for redirecting certain host+uri to a different server (no pools)
2. use data group file to maintain uri-to-server list, so I can keep using the same irule for ot...
hoolio
Cirrostratus
Mar 17, 2010Do you really have clients making requests using several different IP addresses to the same host VIP? Or do you have this iRule applied to multiple host VIPs? Or are you using a 0.0.0.0:80 VIP?
If you add logs to the iRule, can you see what's being hit when you're testing? What does a client see when a failure occurs?
Also, which LTM version are you running? For 10.x, you can use the class command to get a bit more functionality for doing lookups against a datagroup. In 10.1.x, you have even more functionality with address type datagroups that you use.
Aaron
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] request to [HTTP::host][HTTP::uri]"
find a match using host+uri against the class and
returns the whole string (field1 field2 field3)then
set it as newURI variable.
set newURI "[findclass [[HTTP::host][HTTP::uri]] $::redlist]"
if { $newURI ne "" } {
log local0. "[IP::client_addr]:[TCP::client_port]: Matched line $newURI"
Parse the three fields in the matched datagroup line
scan $newuri {%s %s %s} unused host uri
log local0. "Parsed: $unused $host $uri"
change host and uri
if {$host ne ""}{
HTTP::host $host
}
if {$uri ne ""}{
HTTP::uri $uri
}
}
}
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