eirikn
Feb 17, 2016Nimbostratus
URI pool selection using Data Groups (iRule)
Hi,
Im trying to use a data group for pool selection with certain URI's, but I cant get it to work.
This is my Data Group (only one entry atm)
ltm data-group internal /DMZ/dg_dmz_foobar.customer.com_app {
records {
/test-uri-web {
data pool_web_pool
}
}
type string
}
This is my iRule:
when HTTP_REQUEST {
log local0. "DMZ test request: [HTTP::uri] IP: [IP::remote_addr] port [TCP::local_port]"
set app_pool_destination [class match -value [string tolower [HTTP::uri]] starts_with dg_dmz_foobar.customer.com_app ]
if { $app_pool_destination ne ""} {
pool $app_pool_destination
nexthop 172.21.179.1
}
Expected result: User is browsing a host with a URI that starts with "/test-uri-web" The correct pool is selected acording to the data group value of that URI. There will be alot of these entry's, hence the datagroup.
Any help is appreciated!