Forum Discussion

David_Ratta_104's avatar
David_Ratta_104
Icon for Nimbostratus rankNimbostratus
Oct 01, 2008

source_addr persistence timeout based on uri

I have a requirement to set the persistence timeout associated with virtual server based on URI.

 

 

In other words, if you browsed /sixty/ the source_addr_60 persistence profile would be applied and if you browsed /twenty/ the source_addr_20 persistence profile would be applied.

 

 

Can this be accomplished using an iRule?

 

 

 

 

2 Replies

  • You can use the persist command (Click here) to specify how to persist the client, but you can't actually specify a custom persistence profile:

       
       when HTTP_REQUEST {   
          
           Persist based on the requested URI (case-insensitive)   
          switch -glob [string tolower [HTTP::uri]] {   
          
             "/twenty*" {   
                 Persist the client for 20 minutes based on source IP with /32 mask   
                persist source_addr 255.255.255.255 1200   
             }   
             "/sixty*" {   
                 Persist the client for 60 minutes based on source IP with /32 mask   
                persist source_addr 255.255.255.255 3600   
             }   
             default {   
                 Take some default action?   
             }   
          }   
       }   
       

    You should consider adding a OneConnect profile to the VIP when using a rule like this. (Click here) for details.

    Aaron