Forum Discussion
6 Replies
Sort By
- hooleylistCirrostratusYou can inspect the cookies a client presents with the HTTP::cookie commands. You can set a node for a specific request using the node command. You can check the respective wiki pages for HTTP::cookie (Click here) and node (Click here), or search the forums for examples. Repost here if you have any questions.
- Shay_Ben-David1Nimbostratusthanks for the assist, but nothing here helps in this, i need irule example for track the client request and decide wich server to get the client according to the cookie name and value, here is an example of what i try, but i can't get it work, when i come to the vip it do load balancing eventhough i have irule on the vip.
- hooleylistCirrostratusHi,
when HTTP_REQUEST { if { [HTTP::cookie exists "amlbcookie"] } { log local0. "[HTTP::cookie "amlbcookie"]" switch -glob [HTTP::cookie "amlbcookie"] { *01* { node 192.168.10.66 log local0. "matched 01" } *02* { node 192.168.10.67 log local0. "matched 02" } } } else { pool skyp-AM-1873 log local0. "default" } }
- unRuleY_95363Historic F5 AccountBTW, "switch" by default is an exact match. You need to add "-glob" to match with *'s.
- Shay_Ben-David1Nimbostratusthanks guys, seems to be better, but i didnt understand the log, there is two time "Default", should that be, because if he got a match, why using the pool ?
- Colin_Walker_12Historic F5 AccountI would imagine that requests with no cookie, or at least with a cookie that doesn't have the value you're expecting, would log the "default" message.