Forum Discussion
Chad_Roberts_21
Nimbostratus
Jun 14, 2006Pools and Persistence
I'm having a persistence issue with an iRule I am testing on a site that will be partially inaccessible on holidays. The code below is part of an experiment to find the syntax that will make this work...
Chad_Roberts_21
Nimbostratus
Jun 14, 2006I meant to mention that I thought that might be what you meant but that I tried that too. Actually, when you just bump it one level back, it negates the pool command from within the if statement.
However, while I awaited your reply, I realized the solution to that problem. I simply need to start the HTTP_REQUEST script with a pool definition and negate it instead when the if statement matches. It finally works using this:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST timing on {
pool $default_pool
if { ([HTTP::uri] starts_with "/sc/") } {
set current_date [clock format [clock seconds] -format {%D} ]
if {([matchclass $current_date equals $::Holidays ] )} {
HTTP::uri "/offhour.html"
log "Blocked for holiday"
persist none
pool after_hour_pool
}
else {
log "Access to SC allowed"
}
}
}Thanks for your help! You've saved me again.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects