Actually, that does present a new issue. I showed a simple version of my iRule yesterday because the rest of what I've actually used was not relevant to the conversation at hand, but the full code I used doesn't check out when I try to change it to CLIENT_ACCEPTED.
The particular virtual server for which this iRule was created hosts multiple domains, and not all of them should be unavailable after hours. As a result, I need to be able to check the host name for one and the path for another, send those to an after-hours pool, and allow the rest through as normally planned. Also, for reasons I won't get into, I have to rewrite the uri so that the path is only "/" when it hits the after-hours pool.
when HTTP_REQUEST {
set current_day [clock format [clock seconds] -format {%a} ]
set current_time [clock seconds]
set time_min [clock scan {08:00}]
set time_max [clock scan {17:00}]
set uri [HTTP::uri]
if { ([HTTP::host] eq "www.domain.com") or ([HTTP::uri] contains "/folder") } {
if {($current_day == {Sat}) or ($current_day == {Sun})} {
HTTP::uri "/"
pool test_clock_pool
}
elseif {($current_time < $time_min) or ($current_time > $time_max)} {
HTTP::uri "/"
pool test_clock_pool
}
}
}
When I attempt to change it to CLIENT_ACCEPTED, I receive the following error:
01070151:3: Rule [irule_test_SC_business_hours] error:
line 6: [command is not valid in current event context (CLIENT_ACCEPTED)] [HTTP::uri]
line 8: [command is not valid in current event context (CLIENT_ACCEPTED)] [HTTP::host]