Forum Discussion
dathomas111_201
Altocumulus
May 22, 2013irule cookie insert
Hi,
I'm reaching out to the community in hope of getting irule assistance. I need to be able to create an irule that meets the following crtieria. As a plus it would be great to reference a str...
nitass
Employee
May 22, 2013is it something like this?
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.252:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b pool foo list
pool foo {
members {
200.200.200.101:80 {}
200.200.200.111:80 {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [HTTP::cookie exists webserver] } {
persist uie [HTTP::cookie value webserver]
}
}
when HTTP_RESPONSE {
switch [IP::server_addr] {
200.200.200.101 { set cookie_value "wsA" }
200.200.200.111 { set cookie_value "wsB" }
}
HTTP::cookie insert name webserver value $cookie_value
persist add uie $cookie_value
}
}
client
[root@centos17 ~] curl -I http://172.28.19.252 -H "Cookie: webserver=wsA"
HTTP/1.1 200 OK
Date: Thu, 23 May 2013 00:34:49 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Thu, 23 May 2013 00:28:46 GMT
ETag: "4185a8-59-c3efab80"
Accept-Ranges: bytes
Content-Length: 89
Content-Type: text/html; charset=UTF-8
Set-Cookie: webserver=wsA;
persistence record
[root@ve10:Active] config b persist show all
PERSISTENT CONNECTIONS
| Mode universal Value wsA
| virtual 172.28.19.252:80 node 200.200.200.101:80 age 3sec
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