Forum Discussion

prax_73377's avatar
prax_73377
Icon for Nimbostratus rankNimbostratus
Mar 18, 2011

Redirect to a pool based on cookie value

Hi Gurus,

 

 

Need some help with iRules, I am oracle applications dba and do not know much about the iRule thing in F5. We have 4 web server nodes and I defined 4 pools one server in each pool.

 

PoolA

 

PoolB

 

PoolC

 

PoolD

 

 

 

I am trying to direct a call from Oracle applications based on value of cookie. Then name of cookie is "OracleCookie"

 

if the value has "OraB" direct to Pool-B, "OraC" direct to Pool-C. "OraD" direct to Pool-D and default direct to Pool-A,

 

 

 

I have a iRule like this:

 

when HTTP_REQUEST {

 

Try to select a pool based on the http cookie containing pool information

 

if { [HTTP::cookie exists "OracleCookie"] and [HTTP::cookie value "OracleCookie"] contains "OraB"} {

 

use pool Pool-B

 

log INTB-Pool-B

 

}

 

elseif { [HTTP::cookie exists "OracleCookie"] and [HTTP::cookie value "OracleCookie"] contains "OraC"} {

 

use pool Pool-C

 

log Pool-C

 

}

 

elseif { [HTTP::cookie exists "OracleCookie"] and [HTTP::cookie value "OracleCookie"] contains "OraD"} {

 

use pool Pool-D

 

log Pool-D

 

}

 

else {

 

use pool Pool-A

 

log Pool-A

 

}

 

}

 

 

 

The rule compiled fine, however the load balancer does not re-direct to the pool. The request comes in a new window opens but nothing is in the page eventually get page cannot be displayed. Could you please let me know if the iRule is correct and any idea how I can trouble shoot this

 

 

 

Thanks in advance!

 

Prax

 

1 Reply

  • Hi Prax,

     

     

    Check your post here for replies:

     

     

    http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/1178404/showtab/groupforums/Default.aspx

     

     

    Aaron