Thanks for the reply. Actually the third octet match would be more of a selective match like 3rd octet = 25, 30, etc...
I am doing something similar on the ltm using the following rule:
when HTTP_REQUEST {
set abtest_pool "wa-en-varnishab_pool"
set default_pool "ac-ad_pool"
set abtest_web_pool "wa-en-webab_pool"
set term [getfield [IP::client_addr] "." 3]
log local0. "Client IP is [IP::client_addr] and term 3 is $term."
if {[HTTP::header User-Agent] contains "noabtest4me"} {
pool $default_pool
log local0. "Client sent noabtest4me header and is exempt from the ab test."
}
elseif {[HTTP::header User-Agent] contains "abtestme"} {
HTTP::header insert "answ_abtest" "true"
pool $abtest_pool
log local0. "Client sent abtestme and forced ab test participation."
}
elseif {[class match $term equals abtest_ips]}{
if {![class match [HTTP::header User-Agent] contains botagents]}{
if {[active_members $abtest_pool] >= 1 && [active_members $abtest_web_pool] >= 1} {
pool $abtest_pool
HTTP::header insert "answ_abtest" "true"
log local0. "hit AB pool from [IP::client_addr] to [HTTP::uri] and term is $term"
}
else {
pool $default_pool
log local0. "hit AB pool but all servers were down from [IP::client_addr] to [HTTP::uri]"
}
}
}
I tried doing the same on the GTM with the below rule:
when DNS_REQUEST {
set term [getfield [IP::client_addr] "." 3]
if {[class match $term equals resellerrating10percent_ips]}{
cname www-1378117844.us-west-1.elb.amazonaws.com
} else {
cname lb-www-1818231038.us-west-1.elb.amazonaws.com
}
}
resellerrating10percent_ips
5
6
24
But just realized that the GTM doesn't support "Data Group Lists" to set the $TERM statement.
Basically, what I am trying to accomplish is some Amazon CDN switching using 2 different CNAME's with a 90/10 resolution split. The CNAME that gets the 90 percent is the legacy one and the one with the 10 percent is a new one that we would like to test with production traffic. Since there is a 90/10 split, I need to make the client connections somehow sticky to the same CNAME and associated AWS servers. That was the thought of match the 3rd octet so the recycled client connections would always get the same CNAME resolution for persistence.