Forum Discussion
lipos_54863
Nimbostratus
Aug 05, 2009persisting on a cookie
Hi,
I'm wondering is there a way to create a persistence based on a cookie when checking only first three letters of the cookie name?
Here's my example:
when HTTP_RESPONSE { ...
lipos_54863
Nimbostratus
Aug 06, 2009I think I finally got it.
Thanks!
}timing on
HTTP responds catches the first responds from the node to back to the client.
It checking all cookies in the header and grabs all starting with 1234.
After it adds the cookie value to the persistance table and log values to syslog.
Else persist the client for 60 minutes based on source IP with /32 mask and log values to syslog.
when HTTP_RESPONSE {
foreach a_cookie [HTTP::cookie names] {
if {$a_cookie starts_with "1234"}{
persist add uie [HTTP::cookie "$a_cookie"]
log local0.debug "Cookie persist - client IP: [IP::client_addr], Cookie: $a_cookie, Server IP: [IP::server_addr]"
} else {
persist source_addr 255.255.255.255 3600
log local0.debug "Source persist - client IP: [IP::client_addr] , Server IP: [IP::server_addr], lookup [persist lookup uie [IP::client_addr]]"
}
}
}
HTTP request catches the first responds from the node to back to the client.
It checking all cookies in the header and grabs all starting with 1234.
After it persist on the cookie value in the persistance table.
Aslo, log values to syslog
when HTTP_REQUEST {
foreach a_cookie [HTTP::cookie names] {
if {$a_cookie starts_with "1234"}{
persist uie [HTTP::cookie "a_cookie"]
log local0.debug "Client IP: [IP::client_addr], Cookie value: $a_cookie"
} else {
persist uie [IP::client_addr]
log local0.debug "Source IP Persistence used - Client IP: [IP::client_addr], Persistance entries used persist uie [persist lookup uie [IP::client_addr]]"
}
}
}Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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