Forum Discussion
Sven_89244
Nimbostratus
Aug 27, 2009Trying Cookie persistance
Hello to all,
I've trying to implement a cookie-based persistance.
The scenario is:
The client asks webserver with a /GET /es? and was balanced.
If they ask GET /hrs/... the server responds with a Header context: env=hrs
If this occurs the LTM should insert a Cookie "bigippersistance" with 4h(=14400 sec) timeout.
This rule is attached to a VS "test.hrpa.siemens.com" with a pool "test.hrpa.siemens.com"
My rule
when HTTP_REQUEST {
if { [HTTP::uri] contains "/es1/" } {
pool test.hrpa.siemens.com member 139.25.231.229
persist none
} elseif { [HTTP::uri] contains "/es2/" } {
pool test.hrpa.siemens.com member 139.25.231.230
persist none
} elseif { [HTTP::uri] contains "/es/" } {
pool test.hrpa.siemens.com
persist none
} elseif { [HTTP::uri] contains "/hrs/" } {
pool test.hrpa.siemens.com
persist uie [HTTP::cookie bigippersistance] 14400
} else {
drop
}
}
when HTTP_RESPONSE {
if {[HTTP::header context] contains "env=hrs"} {
set a_cookie [format "%08d" [expr { int(100000000 * rand()) }]]
HTTP::cookie insert name bigippersistance value [concat $a_cookie [LB::server] [IP::client_addr]]
persist add uie [HTTP::cookie bigippersistance] 14400
log local0. "Cookie persist - client IP: [IP::client_addr], Cookie: [HTTP::cookie names], Server IP: [IP::server_addr]"
}
}
The iRule-parser says it's o.k.
when invoked I get folling /var/log/ltm- msg
Aug 27 15:45:58 tmm tmm[1572]: 01220001:3: TCL error: URL_eshrs_Testif - bad option "test.hrpa.siemens.com": must be any, virtual, service, or pool while executing "persist add uie [HTTP::cookie bigippersistance] 14400"
What's the mistake?
Please advise - thanks
- hoolio
Cirrostratus
Hi Sven, - Sven_89244
Nimbostratus
Thanks Aaron, - hoolio
Cirrostratus
Hi Sven,
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