23-Sep-2020 07:33
Hi all,
Could someone assist me with an irule that would look at a custom header callled X-Server-Pool. If "xyz" then this pool, if "abc" then this pool, else default.
I think this is a starting point but it doesnt appear to be working
If no header exists it would hit default pool assigned to vip?
23-Sep-2020
08:06
- last edited on
04-Jun-2023
21:17
by
JimmyPackets
Hi sandman748,
Can you look logs with this:
when HTTP_REQUEST {
if { [HTTP::header exists X-SERVER-POOL] } {
log local0. "X-Server-Pool: [HTTP::header X-SERVER-POOL]"
switch [HTTP::header X-SERVER-POOL] {
"xyz" { pool xyz }
"abc" { pool abc }
}
}
}
If no header exists, it hits the default pool. If no default pool exists, it drops. You can add default pool configuration in iRule with using else or switch.
when HTTP_REQUEST {
if { [HTTP::header exists X-SERVER-POOL] } {
log local0. "X-Server-Pool: [HTTP::header X-SERVER-POOL]"
switch [HTTP::header X-SERVER-POOL] {
"xyz" { pool xyz }
"abc" { pool abc }
default { defaultpool }
}
}
}