Selecting persist profile

I’m sure I’m missing something obvious here but I can’t figure it out.

I need to achive something like this in an iRule:

if { statement } {
   persist profile_one
   use pool pool_a
 }
 elseif { statement } {
   persist profile_two
   use pool pool_a
 }
 elseif { statement } {
   persist none
   use pool pool_a
 }

Where profile_one and profile_two are two different cookie insertion profiles (different timeouts)

What I need is how to make the persistance profile selection above work, “persist profile_name” is clearly not the right syntax.

It seems to be possible to do “persist cookie insert”

but that appears to use the persistance profile associated with the VS which isn’t really what I need.

Any ideas, scratching my head here.

I’ve just seen the “[iRule - v9.0] URI switching & Persistence” document in the code share. That explains how to set distinct cookie names which half gets to where I need to be, but I still need to be able to set different timeouts.

Also as far as I can tell a VS can only have 2 persistance profiles attached, the default and the fallback. If I want to use 3 different types of persistance, selected with an iRule, how would I go about this?

Any ideas on this?

I’ve been pointed in the direction of this post which answers my query DevCentral - An F5 Technical Community

Are there any plans to make this a bit simpler, i.e. so that you could select a persistance profile directly by name? This would make administration somewhat easier in the case where you have the same pool referenced a few dozen times.

You could always pull the “use pool a” statement out of the braces after the if clause.

As far as I know, there aren’t currently any plans to change the way that this functionality behaves, but you can always submit a change request via Technical Support, and it will be reviewed and considered for future versions.

-Colin