Forum Discussion
Hash Persistence based on HTTP Header "SV" tag
Hello, I am looking for the way how to implement the hash persistence based on http header "SV" tag with iRule. We have one virtual server with few servers mapped to one pool.
Currently we are using the source address persistence method. but it is not effective.
Could someone give me a example of hash persistence with irule to achieve what we want to?
3 Replies
I might be wrong, but the documents on this one mentions cookies rather than headers:
https://support.f5.com/csp/article/K7019
Have you considered using the native cookie persistence, or perhaps a universal one if you insist on using the sv header?
/Patrik
Then you're in the right forum. 🙂
Must confess that I have not done this particular thing, but try this?
First create this irule:
when HTTP_REQUEST { if { [HTTP::header exists "sv"] } { persist uie [HTTP::header value "sv"] } }Then create a universal persistence profile and choose the irule you just created as "irule" in the configuration
Assign the persistence profile to the virtual server.
/Patrik
Worked like a charm. Here's how it looked like on my unit:
curl -k -H "sv: test" -H "Host: www.mysite.com" https://VIP-IP/en/ Sys::Persistent Connections universal test VIP-IP:443 SERVERIP:4000 (tmm: 0) Total records returned: 1 The default timeout is 180 seconds. Are you sure you tested before that?If the sv header is set in the response as well as the request, please add an irule event from for
like this:when HTTP_RESPONSEwhen HTTP_REQUEST { if { [HTTP::header exists "sv"] } { persist uie [HTTP::header value "sv"] } } when HTTP_RESPONSE { if { [HTTP::header exists "sv"] } { persist add uie [HTTP::header value "sv"] } }/Patrik
Recent Discussions
Related Content
* 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
