Forum Discussion
f5_learner_2857
Jan 29, 2010Nimbostratus
Persistence Cookie Logger - undefined procedure
Hello,
I am using the following iRule given at http://devcentral.f5.com/Wiki/default.aspx/iRules/Persistence_Cookie_Logger.html
and am getting the following error. Please advise what could be the problem.
Thanks.
Error:
01070151:3: Rule [PersistenceCookieLogger] error:
line 1: [undefined procedure: rule] [rule persistence_cookie_logger {
iRule:
rule persistence_cookie_logger {
when RULE_INIT {
see AskF5 SOL6917 for cookie encoding details:
https://support.f5.com/kb/en-us/solutions/public/6000/900/sol6917.html
set ::myCookieName BIGipServerXXXX
set ::debug 0
}
when HTTP_REQUEST {
grab encoded cookie value & parse into relevant pieces
if {[HTTP::cookie exists $::myCookieName]}{
scan [HTTP::cookie $::myCookieName] "%d.%d.%d" myIpE myPortE unused
if {$::debug != 0}{log local0. "myIpD=$myIpE myPortE=$myPortE unused=$unused"}
calculate IP
%08x format strings forces padding w/leading 0's to 8 char string
set myIpH [format %08x $myIpE]
if {$::debug != 0}{log local0. "myIpH=$myIpH"}
set myIpD1 [expr 0x[substr $myIpH 6 2]]
set myIpD2 [expr 0x[substr $myIpH 4 2]]
set myIpD3 [expr 0x[substr $myIpH 2 2]]
set myIpD4 [expr 0x[substr $myIpH 0 2]]
set myIpD "$myIpD1.$myIpD2.$myIpD3.$myIpD4"
if {$::debug != 0}{log local0. "myIpD=$myIpD"}
calculate port
set myPortH [format %x $myPortE]
if {$::debug != 0}{log local0. "myPortH=$myPortH"}
set myPortD [string trimleft [expr 0x[substr $myPortH 2 2]][expr 0x[substr $myPortH 0 2]] 0]
if {$::debug != 0}{log local0. "myPortD=$myPortD"}
log results
log local0. "Request from client: \
[IP::remote_addr]:[TCP::remote_port] contains persistence cookie \
referencing pool member $myIpD:$myPortD"
} else {
log local0. "Request from client: [IP::remote_addr]:[TCP::remote_port] \
contains NO persistence cookie"
}
}
}
- hooleylistCirrostratusIf you're adding the rule via the GUI or the iRuler, you need to leave off the object definition line:
- Kirit_Patel_521NimbostratusI am using the persistence_cookie_logger irule . How come I don't see the cookie value. The only thing i see is :
- Chris_MillerAltostratusPosted By Kirit Patel on 12/18/2010 04:51 AM
- Kirit_Patel_521NimbostratusOk is there anyway to display the cookie value?
- Chris_MillerAltostratuslog local0. "Request from client: \
- hooleylistCirrostratusDid you change BIGipServerXXXX to the name of your actual persistence cookie?
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