Forum Discussion
Gary_Bright_120
Nimbostratus
Mar 13, 2006Persist iRule based on URI
Hi there I'm trying to write an iRule that will allow us Admins the choice of selecting a pool member and have persistence with that member.
At the moment we have a persistance profile or source_a...
Gary_Bright_120
Nimbostratus
Mar 15, 2006There are three member in the pool
The logic for the iRule (in my mind (could be completely wrong)
Was, iRule processes a request with gb= in the URI remove any persistence already setup, if any
Then based on the number create a persistence rule with a particular webserver.
As my persistence is set for 15mins I would have up until that time to forward any requests at the virtual server knowing that it will end up at my desired webserver until such time till my persistence timed out or I sent through another request with gb= in the URI.
At the moment it does seem to process the iRule and for each request with gb=1 in the URI direct that request to member 1 but it doesn't setup the persistence.
if I then make another request it will send to any member in the pool.
when HTTP_REQUEST {
if { [URI::decode [string tolower [HTTP::uri]]] contains "gb=" } {
persist none
log "Persist Turn Off"
}
if { [URI::decode [string tolower [HTTP::uri]]] contains "gb=3" } {
use pool webpool member 1.1.1.3 80
persist source_addr 1800
log "Persist Setup to Member 3"
}
if { [URI::decode [string tolower [HTTP::uri]]] contains "gb=2" } {
use pool webpool member 1.1.1.2 80
persist source_addr 1800
log "Persist Setup to Member 2"
}
if { [URI::decode [string tolower [HTTP::uri]]] contains "gb=1" } {
use pool webpool member 1.1.1.1 80
persist source_addr 1800
log "Persist Setup to Member 1"
}
}
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