How can I test to see if HTTP::Status exists?
Here's the error I'm seeing:
TCL error: /Common/www.my.com_irule - Illegal argument. Invalid client side API (line 15) invoked from within "HTTP::status"
So here's what I have, the commeted section where HTTP::status is referenced causes this issue. I suspect it's not seeing a status code and complaining. I'd love to test if HTTP::status exists, if not insert XXX as the status code, and if it does insert the real status code.:
when CLIENT_ACCEPTED {
set hsl [HSL::open -proto TCP -pool syslog_pool]
}
when HTTP_REQUEST {
set http_request_time [clock clicks -milliseconds]
set remote_addr "[IP::remote_addr]"
set LogString1 "<190> $remote_addr \"[HTTP::header Host]\" \"[HTTP::method] [HTTP::uri] HTTP\/[HTTP::version]\" \"[HTTP::header User-Agent]\""
}
when HTTP_RESPONSE {
set http_status XXX
if { [HTTP::status] } {
set http_status [HTTP::status]
}
set LogString2 "[HTTP::status] pool_info: [LB::server] (ResponseTime: [expr [clock clicks -milliseconds] - $http_request_time]ms)"
set LogString2 "$http_status pool_info: [LB::server] (ResponseTime: [expr [clock clicks -milliseconds] - $http_request_time]ms)"
set LogString2 "pool_info: [LB::server] (ResponseTime: [expr [clock clicks -milliseconds] - $http_request_time]ms)"
HSL::send $hsl "$LogString1 | $LogString2 \n"
}