Thanks,
I added a timeout value and have the iRule applied directly to the virtual server rather than using a profile.
It looks like the sessions are persisting correctly from the cli, but I see connections being sent to both servers in the pool through the gui. The connection count is incrementing at the same rate. App issue maybe, I'm going to get at trace on the second server (where connections should not be sent).
For the 'event disable all', I thought that would exit any furthur iRule evaluation once the persistence string is found. Let me know if I misunderstood how it is used.
Would I use the 'persist lookup' within the iRule to verify an entry extists for the session ID string?
I don't understand what you mean by 'client and server hit the same virtual server'.
Also, I used the line 'if {[string is alnum $CliSessionId] == 1}' because I couldn't figure out how to match a null string which shows up in the log as 'ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ', if there are suggestions on matching that string please let me know.
Thanks for your help and patience, and please keep in mind I have very little experience with writing iRules, so if I've made any dumb mistakes, that's why.
I made a couple changes to the current rule, here's the latest:
when CLIENT_ACCEPTED {
log local0. "Buildup -- collecting client data"
TCP::collect 60 0
log local0. "Client data collected"
}
when SERVER_CONNECTED {
log local0. "Buildup -- collecting server data"
TCP::collect 60 0
log local0. "Server data collected"
}
when CLIENT_DATA {
set CliSessionId [string range [TCP::payload] 22 53]
log local0. "Clisession ID is $CliSessionId"
if {[string is alnum $CliSessionId] == 1} {
log local0. "This is an existing connection"
persist uie $CliSessionId
event disable all
}
else {
log local0. "This is a new Session - passthrough"
}
TCP::release
}
when SERVER_DATA {
set SvrSessionId [string range [TCP::payload] 22 53]
log local0. "Svrsession ID is $SvrSessionId"
if {[string is alnum $SvrSessionId] == 1} {
log local0. "Setting Svr Session persistence"
persist add uie $SvrSessionId 300
}
else {
log local0. "Svr Session ID not alnum"
}
TCP::release
event disable all
}