When HTTP Request has specific hostname and URI, redirect to diff Pool
Hi All,
I have been trying to make this below IRule work, But no success. My Client's requirement is to redirect HTTP Traffic for specific Host URL and specific URI to a different Pool. But I am constantly getting this error: TCL error: /Common/poolname - extra switch pattern with no body while executing "switch -glob [string tolower [HTTP::uri]] { "/someURI" { pool "XYZ" } if {$..."
when RULE_INIT { set static::Poolxyz_select_debug 1 log local0. "Poolxyz_select" } when HTTP_REQUEST { if {[string tolower [HTTP::host]] starts_with "api-dev" } { switch -glob [string tolower [HTTP::uri]] { "/someURI" { pool XYZ } if {$static::Pool_select_debug eq 1} {log local0. "[IP::client_addr] with URI of [HTTP::uri] went to XYZ Pool"} } } }
Please help me out, I am kind of new to switch statement, tried using it different ways but still no success. Thank you in advance.
Abe