Hi All - Thank you for your responses. Here is the iRule that worked for us.
when RULE_INIT {
set static::debug 0
set static::cookie_expire_time 86400
set static::refresh_time 10
set static::notification_page " Site unavailable"
}
when HTTP_REQUEST {
set mod_path [lindex [split [string trim [string tolower [HTTP::path]] "/"] "/"] 0]
if { $static::debug } {
log local0. "The variable mod_path is: $mod_path"
log local0. "Refresh Time: $static::refresh_time"
}
switch $mod_path {
"aaaaaaa" -
"bbbbbbb" -
"ccccccc" {
if { $static::debug } {
log local0. "Matched aaaaaaa pool!"
}
pool http_pool
}
"ddddddd" {
if { (not [HTTP::cookie exists NotificationDone]) } {
if { $static::debug } {
log local0. "Cookie was not set in ddddddd! Setting cookie!"
}
HTTP::respond 200 content [subst $static::notification_page] Mime-Type "text/html" Set-Cookie "NotificationDone=[clock seconds]; path=/; domain=.[HTTP::host]"
} elseif { [eval [[clock seconds] - [HTTP::cookie value "NotificationDone"]]] > $static::cookie_expire_time } {
if { $static::debug } {
log local0. "CNotification Done Value: [HTTP::cookie value "NotificationDone"] Expire Time: $static::cookie_expire_time"
}
HTTP::cookie remove "NotificationDone"
HTTP::respond 200 content [subst $static::notification_page] Mime-Type "text/html" Set-Cookie "NotificationDone=[clock seconds]; path=/; domain=.[HTTP::host]"
}
pool http_pool
}
"" -
"eeeeeeee" {
if { (not [HTTP::cookie exists NotificationDone]) } {
if { $static::debug } {
log local0. "Cookie was not set in eeeeeee! Setting cookie!"
}
HTTP::respond 200 content [subst $static::notification_page] Mime-Type "text/html" Set-Cookie "NotificationDone=[clock seconds]; path=/; domain=.[HTTP::host]"
} elseif { [eval [[clock seconds] - [HTTP::cookie value "NotificationDone"]]] > $static::cookie_expire_time } {
if { $static::debug } {
log local0. "CNotification Done Value: [HTTP::cookie value "NotificationDone"] Expire Time: $static::cookie_expire_time"
}
HTTP::cookie remove "NotificationDone"
HTTP::respond 200 content [subst $static::notification_page] Mime-Type "text/html" Set-Cookie "NotificationDone=[clock seconds]; path=/; domain=.[HTTP::host]"
}
pool http_pool
}
}
}