Forum Discussion
st0n3_87491
Nimbostratus
Aug 13, 2009Persistence based on IMAP-User
Hi there,
as topic say I would like to have a persistence to a node based on his IMAP-Userlogin.
I managed to find out this using a stream Profile and wrote this iRule so far:
whe...
st0n3_87491
Nimbostratus
Aug 26, 2009
when CLIENT_ACCEPTED {
Clear the variable imap_login if it exists already on this TCP connection
if {[info exists imap_login]}{
unset imap_login
}
Define STREAM-expression and enable STREAM
STREAM::expression @LOGIN\.*@
STREAM::enable
Enable the STREAM_MATCHED event as it could have been disabled if there was a prior
response on this TCP connection
event STREAM_MATCHED enable
}
when STREAM_MATCHED {
Save the matched value
set imap_login [getfield [STREAM::match] " " 2]
Check if $imap_login isn't empty
if { $imap_login != "" }{
$imap_login isn't empty...so let's continue
log local0. "IMAP Login Information found...continuing"
The iRule parser doesn't allow the persist command in STREAM_MATCHED.
It works though, so hide the command from the parser
set persist_cmd "persist add uie $imap_login"
log local0. "[IP::client_addr]:[TCP::client_port]: Parsed: $imap_login \$persist_cmd: $persist_cmd"
eval $persist_cmd
persist add uie $imap_login
log local0. "[IP::client_addr]:[TCP::client_port]: Added persistence record for $imap_login on server [IP::server_addr]:[TCP::server_port]. Exiting event for this response."
event STREAM_MATCHED disable
} else {
$imap_login is empty...let's stop this here
log local0. "no IMAP Login Information found...aborting"
}
}
I tried to include it as a universal persistence profile into the VIP
and I simply addes the iRule to the VIP.
But there was no difference.
Is it possible that it doesn't work because of the " " around the user@domain.com ?
Some more debug logging would be great!
Thanks in advance!
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