Forum Discussion
Irule to read cookie value of amlbcookie
I have a syntax error with this irule that I cant figure out for the life of me. Can someone help? I am attempting to take connections in with a cookie called "amlbcookie" and then based on the vale 1 or 3 pass to specific nodes and then if not, send it to the default pool.
when HTTP_REQUEST { if { [HTTP::cookie exists "amlbcookie"] } { log local0. "[HTTP::cookie "amlbcookie"]" switch -glob [HTTP::cookie "amlbcookie"] { 01 { node 10.29.35.111 log local0. "matched 01" } 03 {
node 10.29.35.112 log local0. "matched 03” } }
}
else {
pool Auth_SSL_Offload
log local0. "default"
}
}
1 Reply
- Kevin_Stewart
Employee
Minor syntax correction:
when HTTP_REQUEST { if { [HTTP::cookie exists amlbcookie] } { log local0. [HTTP::cookie value amlbcookie] switch [HTTP::cookie value amlbcookie] { "01" { node 10.29.35.111 80 log local0. "matched 01" } "03" { node 10.29.35.112 80 log local0. "matched 03" } } } else { pool Auth_SSL_Offload log local0. "default" } }You need to specify the port when issuing a node command.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
