Forum Discussion
Narendra_26827
Jul 07, 2011Nimbostratus
iRule to read key/value pair from Data Group lists
We
have a requirement with our product that load balancer should be able to send
requests to a particular pool ip based on a configuration file that we should
have in the load balancer. Example: ...
Narendra_26827
Jul 08, 2011Nimbostratus
Thanks Aaron i will take that note into consideration.
Edit:
Now actually for testing purpose i have created the sample class like this
class sample_list {
{
"test1.html" { "192.168.159.128:80" }
"test2.html" { "192.168.159.129:80" }
}
}
and iRule like this
when HTTP_REQUEST {
set key [class match -name [string tolower [HTTP::uri]] contains sample_list]
set value [class match -value $key contains sample_list]
if { $key eq "test1.html" } {
pool Pool1_128 member $value
} elseif { $key eq "test2.html" } {
pool Pool1_128 member $value
} else {
HTTP::redirect "http://www.google.com"
}
}
vip is 192.168.159.130
http://192.168.159.130/test1.html should be served by 192.168.159.128:80 and http://192.168.159.130/test2.html by 192.168.159.129:80 respectively.
Am i doing anything wrong in the above scenario. If you can kindly suggest. I have created this just to test the functionality.
Thanks.
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