Forum Discussion

CLDU's avatar
CLDU
Icon for Nimbostratus rankNimbostratus
Jul 24, 2007

Irule call persistence profile

Hello,

 

I have a Virtual server with 4 backend servers.

 

I create a Irule so we can test the 4 servers one by one:

 

 

when HTTP_REQUEST {

 

if { [HTTP::uri] starts_with "/front"} {

 

if { [HTTP::uri] starts_with "/front1A"} {

 

HTTP::uri "/"

 

node xx.xx.xx.xx 80

 

}

 

if { [HTTP::uri] starts_with "/front2Y"} {

 

HTTP::uri "/"

 

node xx.xx.xx.xx 80

 

}

 

if { [HTTP::uri] starts_with "/front3S"} {

 

HTTP::uri "/"

 

node xx.xx.xx.xx 80

 

}

 

if { [HTTP::uri] starts_with "/front4E"} {

 

HTTP::uri "/"

 

node xx.xx.xx.xx 80

 

}

 

}

 

}

 

 

But with this irule the cookie persistance profile don't match anymore.

 

how can i call my persistance profile in the irule.

 

 

I see persistence after first rule pick, this is what I want but with the persistance profile I already create.

 

 

Thanks for your help,

 

Clement

 

1 Reply

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    You should be able to call your persistence profile by name with the persist command.

    So assuming you had a persistence profile named "MyCookiePersistence" you could do:

    
    when HTTP_REQUEST {
      if { [HTTP::uri] starts_with "/front"} {
      if { [HTTP::uri] starts_with "/front1A"} {
      HTTP::uri "/"
      persist MyCookiePersistence
      node xx.xx.xx.xx 80
    }
    ...

    HTH,

    Colin