HTTP::cookie, SWITCH and multiple identical pools
Hello Everyone,
I must load balance a suite of applications across four nearly identical pools using a single virtual server; pool_a thru pool_d. The application team wants to distinguish between pools by specifying /$pool_name/ in HTTP::path but only on the very first query. All other subsequent queries are identical across the pools. I needed a method to determine whether the request had already been load balanced so I added cookie persistence. Please note I am not looking for a specific cookie just any BigIP cookie. Here is my pseudo-code.
when HTTP_REQUEST {
if [HTTP::cookie] exists "BIGIP*"
then persist cookie
else {
switch -glob [string tolower [HTTP::path]] {
"/pool_a*" {
HTTP::path "/"
pool "pool_a" }
"/pool_b*" {
HTTP::path "/"
pool "pool_b" }
"/pool_c*" {
HTTP::path "/"
pool "pool_c" }
"/pool_d*" {
HTTP::path "/"
pool "pool_d" }
default { reject }
} }
}
I welcome any comments on the best method to accomplish this request. Forgive me, I am new at iRules. I have tried to get the app team to prefix every query with /$pool_name/ but they have resisted.
Thanks Jim