Forum Discussion

TLL_91858's avatar
Icon for Cirrus rankCirrus
Jul 22, 2015

specific pool member based on URI reruns causing failure

I have an iRule that runs to allow me to test a specific pool member provided I put a special word in the uri; the application is a java app, and the Java part works fine. The problem is when the application comes back to run a report, it changes the uri and the HTTP_REQUEST runs again putting me in the wrong pool. I thought the cookie would prevent this from happening, but it's not. Here's the code


if {not [HTTP::cookie exists "admintest"]}
  if {[string tolower [HTTP::uri]] ends_with "admin"}
{ pool Test_Pool member ; 
log local0. "WELCOME [HTTP::uri]" }
else {
pool TEST_Pool member ;
log local0. "This is not the right place" }
   HTTP::cookie insert name "admintest" value "IamTesting"


2 Replies

  • You need to do something if the cookie is set. eg when HTTP_REQUEST if cookie set, use Test_Pool if cookie not set, check URI, set cookie and use Test_Pool
  • Isn't it doing that? If cookie is not set, run second if statement, else just end and move on??