Forum Discussion
DineshVM_265886
Altostratus
Jan 24, 2017Persist cookie serverID iRule
I want write an equivalent iRule for a Brocade load balancer Content Switching rule. Below is the CSW rule in Brocade. Basically the rule is to search for the Server ID in the Cookie header and persi...
DineshVM_265886
Altostratus
Jan 24, 2017This is the full Brocade rule. I was able to build the iRule for the other CSW rules below. But I couldn't find an equivalent iRule for the one I mentioned in the actual question.
csw-rule "path" url equals "/"
csw-rule "sticky" header "cookie" search "ServerID="
csw-policy "vip"
match "path" redirect "*" "/xyz" ssl
match "sticky" persist offset 0 length 4 group-or-serverid
default forward 1
default rewrite insert-cookie "ServerID" " * " " * " 60
I thought the iRule would look something like the below. I am not sure if the below one is right. But still working on putting together all the pieces.
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" }{
HTTP::redirect "https://[HTTP::host]/arch" }
elseif { [HTTP::header "cookie"] equals "ServerID=" } {
persist cookie
}
else {
pool default_pool
HTTP::cookie insert ServerID
} }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects