stan_peachey_86
Nov 13, 2015Cirrus
findclass to class iRule help request
We had a v9.x iRule that called an internal datagroup (xxx_direct) via findclass and logged connections. I'm mostly concerned about proper use of class command to call datagroup. We are upgrading to v11.6; any suggestions for iRule improvement are greatly appreciated.
when HTTP_REQUEST {
set url [HTTP::header Host][HTTP::uri]
set host_org [ substr [HTTP::header Host] 0 "." ]
set host_org [ string tolower $host_org ]
set host [ substr $host_org 0 "_" ]
set org [ substr $host_org 7 "-" ]
set host_header_value $org.bla.blah.edu
HTTP::header replace Host $host_header_value
set direct [ findclass $host $::xxx_direct " " ]
pool xxx member $direct:80
}
when HTTP_RESPONSE {
set client [IP::client_addr]
set server [IP::server_addr]
log local0. "xxx_direct: url:$url client:$client server:$server
host_header:$host_header_value"