Forum Discussion
Andy_McGrath
May 02, 2019Cumulonimbus
Cannot access a variable set in
RULE_INIT
unless it is a global (don't do it!) or a static, better to set it in CLIENT_ACCEPTED
it is minor overhead and quicker to update and apply
Some other minor changes but think the following should work for you:
when CLIENT_ACCEPTED {
set debug 1
}
when HTTP_REQUEST {
if {$debug} {
set LogString "Client [IP::client_addr]:[TCP::client_port] -> [HTTP::host][HTTP::uri]"
log local0. "============================================="
log local0. "$LogString (request)"
foreach aHeader [HTTP::header names] {
log local0. "$aHeader: [HTTP::header value $aHeader]"
}
log local0. "============================================="
}
switch -glob [HTTP::header "SOAPAction"] {
"http://www.user.com/CustomerFacingWebsite/Customer" -
"http://www.user.com/CustomerFacingWebsite/Points" -
"http://www.user.com/CustomerInquiry/Balances" {
if { [active_members qa2-pool] > 0 } {
pool qa2-pool
} else {
pool qa1-pool
}
}
}
}