Forum Discussion
How assign a non-default persistence profile in an irule?
We are using a virtual server for HTTP.
We do selection of pool based on HOST using irule. If sicky persistence is needed we set the persistence to source-addr.
Now we would like to set mirror persistence for some selections. How can we do this - or how can we assign a non-default persistence profile to a specific entry (using irules).
Thanks
6 Replies
- Vitaliy_Savrans
Nacreous
you can use something like this:
when HTTP_REQUEST { Check the requested URI switch -glob [HTTP::uri] { "/abc.com/* { pool abc_pool persist source_addr 0 } default { pool defaul_pool } } } - jan_de_wachter_
Nimbostratus
OK. This is the way I am doing it, but I would add mirror persistence. The persist only admits the persistence type mask and time. I don't know how to set the mirror. I only see it by creating a new persistence profile, but how assign it to a specific case??
- Vitaliy_Savrans
Nacreous
It depends on, what is "specific case" for you? Is it source address, url? Yes, for mirroring you need a new persistence profile (I didn't find how to do that in aanother way).
- jan_de_wachter_
Nimbostratus
Yes that is what I supposed to do. But I don't want to select this "new" profile in all cases. Mostly I even don't need sticky (persist none), but in other cases (same virtual server) I need persist source-address and sometimes source-address with mirror persist.
How can I realize this in 1 irule?
- Vitaliy_Savrans
Nacreous
when HTTP_REQUEST { if { [HTTP::uri] equals "/admin" } { pool your_pool persit source_add_mirroring 0 } } elseif {[IP::client_addr] equals "192.168.5.43" } { pool your_pool pesist source_add 0 } else { pool default_pool } } - jan_de_wachter_
Nimbostratus
When I write a persist "ownname" I get following error message (with irule GUY): 01070151:3: Rule [/Common/testjdw] error: /Common/testjdw:16: error: [badoption][source_addr_mirroring]
my code: when HTTP_REQUEST {
switch -exact "[string tolower [HTTP::host]]" { "acc-search.infrabel.be" { persist none } "acc-mediaservice.infrabel.be" { persist source_addr 255.255.255.255 180} "acc-my.infrabel.be" { persist source_addr_mirroring 0 } "acc-officeweb.infrabel.be" { persist source_addr 255.255.255.255 180} default { pool $default_pool } }}
and I defined source_addr_mirroring as a new persistence profile
Any idea??
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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