Forum Discussion

gefa_105039's avatar
gefa_105039
Icon for Nimbostratus rankNimbostratus
Dec 10, 2004

How to persist on value in the URI

Is it possible to persist on a value in the URI?

 

 

We then could write a a iRule where we check this value, in this case a server-id. We could write a iRule where we define every value of the server-id.

 

 

It would be nice to have that the F5 builds a table for the server-id and make the lb based on this value in the request.

 

 

Example:

 

http://www.mysite.com?srvid=srv1

 

 

where

 

srvid: is the variable

 

srv1: value to persist on

 

 

Any suggestions are welkom.

 

 

Regards,

 

Gerard.

1 Reply

  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    What you are referring to is what we call Universal Persistence.

    To do this you need to use a rule to extract the portion of the uri you want to persist on and then execute the persist uie command with that value.

    Here is an example that persists on the uri query string's "srvid" value:

     
     rule uri_persist { 
        when HTTP_REQUEST { 
           set srvid [findstr [URI::query [HTTP::uri]] "srvid=" 6 ";"] 
           if { $srvid ne "" } { 
              persist uie $srvid 
           } 
        } 
     }