Forum Discussion
Raimar_Melchior
Nimbostratus
Jul 13, 2005Cookie Persistence with iRule
Hi everybody,
I want to achieve cookie persistence by means of extracting a string from a cookie and directing the client to the appropriate pool member based on that unique string. It would also be nice when a match would be logged.
Cookie: BBIGipServerpoola=353479690.11465.0000;JServSessionId1111...
1111 is the unique string which should be extracted (1111 identifies node1 and 2222 identifies node2). The pool has only this two members.
I would be very pleased when someone could give me a sample iRule on this.
Thanks
cyb
- Martin_MachacekHistoric F5 AccountAssuming that your unique identifier is really part of the cookie name and not the cookie value, following configuration should work:
class my_nodes { "1111 10.1.1.1:80" "2222 10.1.1.2:80" } pool my_pool { select mapclass2node(findstr(http_header("Cookie"), "JServSessionId", 14, 4), my_nodes) member 10.1.1.1:80 member 10.1.1.2:80 } virtual 1.2.3.4:80 { use pool my_pool }
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