Forum Discussion

James_Thomson's avatar
Dec 10, 2004

mapclass2node

Along the same lines off an an earlier post by Natty about persistence. I'm trying to just read a cookie that is handed out by the server and persist a user on it. One example is where the cookie is static and therefore, I thought of user mapclass2node.

 

 

class nodes {

 

"s1s1 10.11.1.10:80"

 

"s1s2 10.11.1.20:80"

 

}

 

 

I'd like to search the request and map as appropriate. I used to do this in the pool with a select command:

 

select mapclass2node ((http_cookie,("server")),nodes)

 

 

How does this work now? Do I need to do a when HTTP_REQUEST and then some if statement.

 

 

when HTTP_REQUEST {

 

if {HTTP::cookie]} {

 

select mapclass2node((http_cookie,("server")),nodes)

 

}}

15 Replies

  • Thanks unRuley and Joe, I will give that a try tonight. Should I set the default pool and the default persistence profile to none?
  • Well, I gave it a try last night and it doesn't seem to be using the iRule at all. In fact, in my Virtual server, if I didn't have the default persistence set to cookie, if would just follow the round robin rules of the pool. I did write the rule with the log statement, where does that log get written? Also, could this have anything to do with the http profile? Would/should I set up a custom one?

     

     

    Sorry to be so stubborn and I appreciate the help.
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    The log outputs to /var/log/ltm.

     

     

    Unfortunately, it's very hard for us to debug problems like this over the forum as we do not have access to your box. You may want to consider opening a case with support to help you get to the bottom of why your rule isn't being run.

     

     

    Are you sure the rule is assigned to the virtual server?
  • Dear Sirs,

     

    I must apologize for my none programming ways. The above examples did in fact work, but I was looking for the wrong thing. Where I was searching for

     

     

    set server [HTTP::cookie "server"]

     

     

    I should have been searching for

     

     

    set server [HTTP::cookie "SERVER"]

     

     

    I found this out by adding a log statement to tell me what it was finding. I also looked into what the IIS servers were sending out. I appreciate all your help and I have learned a lot from this excersize. And Joe, I would really like to see that list of commands when you get it completed. Thanks again everyone.

     

     

    Dave