Forum Discussion
darragh_19954
Nimbostratus
Nov 09, 2007TCL runtime error with persist lookup
Hi,
We are using an iRule to manage users between 2 pools of servers, based on various bespoke rules.
When the requests are from cookie-enabled clients, we can successfully use coo...
darragh_19954
Nimbostratus
Nov 14, 2007Thanks to the help above and some more scurrying around, we got it working. Here's how it was done:
In the BIG-IP GUI, we specified a default pool and persistence profile (universal) under the resources tab of the virtual server running the iRule.
We then used the [session] command to store the pool outcome for a given IP/UA combination when we suspected the client was cookie-disabled.
Here's the code we used in the HTTP_REQUEST event:
create sessionID from IP and UA combianton (removing spaces)
set SessionID [string map {" " "_"} "[IP::remote_addr].[HTTP::header User-Agent]"]
check persistence table for previous requests
switch [session lookup uie $SessionID] {
"A" { set PoolVal "A" }
"B" { set PoolVal "B" }
default {
do other stuff to set Pool value
}
}
based on pool value, set the destination pool for request
switch $PoolVal {
"A" { pool poolA }
"B" { pool poolB }
default { pool poolA }
}
persist the session ID for repeat requests
session add uie $SessionID $PoolVal 1800
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
