I have seen around and tried to find something similar but havent found much.
The requirement is as follows and needed some help with it.
Client connects to VIP initially, it will not have any cookie info- this needs to go to pool 1.
pool1 contains same nodes of pool2 and pool 3, so basically pool 1 = pool 2+pool 3
if LB selects node from pool1 that belongs to pool2 as well - set cookie "TC" (big ip should do cookie insert)
if LB selects node from pool1 that belongs to pool3 as well- set cookie "DY"(big ip should only send back the cookie set by server ie big ip is passive)
Any subsequent requests from client with these cookies(TC,DY) willl go to pool 2, pool3 respectively.
below is what i have tried so far, but do not know how to create a hash for the server IP and port and add it to irule while inserting cookie. I know something significatnt is missing, any pointers will be helpful.