Forum Discussion
Robert_47833
Altostratus
Oct 31, 2012small question in "persist"
virtual test {
snat automap
destination 1.1.1.1:http
ip protocol tcp
rules test-irule
profiles {
http {}
oneconnect {}
tcp {
serverside
}
}
}
}
here is the question,I want http request going through this vip can persisit via one cookie in the http head,let 'us say it as cookie-1,I don't need bigip add this cookie for me ,it is already there,
due to some reason,I can't add profile in this vip,I only want to use irule to achiveve,
it seems cookie hash is not a bad choice
would u like show me how to achieve this?
4 Replies
- nitass
Employee
is universal persistence applicable? - hoolio
Cirrostratus
I think you'd need to add a cookie persistence profile to use any of the persist cookie iRule commands. The simplest solution from a BIG-IP perspective would be to use cookie insert so BIG-IP doesn't need to track any sessions in its memory. If it really isn't an option to add a persistence profile, you could use persist uie from an iRule:from: https://devcentral.f5.com/wiki/iRules.Weblogic_JSessionID_Persistence.ashx when HTTP_REQUEST { Log details for the request set log_prefix "[IP::client_addr]:[TCP::client_port]" log local0. "$log_prefix: Request to [HTTP::uri] with cookie: [HTTP::cookie value my_cookie]" Check if there is a my_cookie cookie if { [HTTP::cookie "my_cookie"] ne "" }{ Persist off of the cookie value with a timeout of 1 hour (3600 seconds) persist uie [string tolower [HTTP::cookie "my_cookie"]] 3600 Log that we're using the cookie value for persistence and the persistence key if it exists. log local0. "$log_prefix: Used persistence record from cookie. Existing key? [persist lookup uie [string tolower [HTTP::cookie "my_cookie"]]]" } } when HTTP_RESPONSE { Check if there is a my_cookie cookie in the response if { [HTTP::cookie "my_cookie"] ne "" }{ Persist off of the cookie value with a timeout of 1 hour (3600 seconds) persist add uie [string tolower [HTTP::cookie "my_cookie"]] 3600 log local0. "$log_prefix: Added persistence record from cookie: [persist lookup uie [string tolower [HTTP::cookie "my_cookie"]]]" } }
- Robert_47833
Altostratus
hi,Aaron - Robert_47833
Altostratus
actually this cookie-1 is added by me in irule in http response event
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