ScottTS
Mar 20, 2014Nimbostratus
class statement irule
Hi. i was able to get this irule working with older code, but am struggling with the new class command that replaces findclass with 10.2 code. This is with 10.2.4 code. The irule performs a redirect by performing a lookup in a data class file. It works with the first five or so rows, but then fails on every row after that. Any help would be appreciated. thanks Scott
class apache_da_mapping {
type string
filename "/config/apache_da_class.dat"
separator "+="
}
rule wng_apache_instance-rule {
when HTTP_REQUEST {
set mapurl [class lookup [HTTP::host] apache_da_mapping]
log local0. "[HTTP::host] Match? $mapurl"
if {$mapurl ne ""}{
log local0. "[HTTP::host] Redirecting client to http://$mapurl[HTTP::uri]"
HTTP::redirect "http://$mapurl[HTTP::uri]"
}
}
}
`
/config/apache_da_class.dat (sample) works up to the alamo line. fails when it tries to match the first ent line and everything after.
`"alm-lab2-d910" += "alm-lab2-d91.corp.ec.com:8760",
"alm-lab2-d910.corp.ec.com" += "alm-lab2-d91.corp.ec.com:8760",
"ent-pt-lab2-a900" += "ent-pt-lab2-a90.corp.ec.com:8750",
"ent-pt-lab2-a900.corp.ec.com" += "ent-pt-lab2-a90.corp.ec.com:8750",