Hi all,
Could someone just check this over for me please.The goal is to add some
persistence based on version cookie,so we can direct version specific traffic to specific pools.
In addition we also need to direct traffic for a specific URI out of a different SNAT,so it can be checked by a passive AV proxy.
Requirements are:
1. No cookie , so the request goes to the default pool.
2. Version cookie exists and matches the URI so send out of a different SNAT to the AV gateway pool.
3. There is a version cookie but no matching URI.
I’ve put together the following which the LTM accepts.In addition to it working,I need to make it as efficient as possible.Is this the best way to do this?
when HTTP_REQUEST {
Set deault pool
set defpool [LB::server pool]
Extract the Cookie
set ID [findstr [HTTP::cookie “CookieX”] “Cookie” 10 “;”]
Extract the URI
set my_uri [string tolower [HTTP::uri]]
Log the values
log local0. “ID is $ID default pool is $defpool”
If no Cookie exists
if {($ID equals “”)} {
log local0. “sending user to pool $defpool”
pool $defpool
If there is a cookie and a URI of /AttachmentShare/Upload.aspx
}
elseif {[$my_uri contains “/AttachmentShare/Upload.aspx”] and [ $ID not equals “”] } {
log local0. “URI contains $my_uri sending user to pool pool$ID”
[pool AVpool$ID] and [snatpool SNAT_$ID]
}
else {
If there is a cookie but no URI
pool pool$ID
}
}
Thanks in advance,
Adam