Forum Discussion
darragh_19954
Nov 14, 2007Nimbostratus
Thanks 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