Data Groups for HTTP redirects -- can't find element in DG with class match
I am trying to get an iRule to look at a data group and if it finds a match, redirect to the value in the element, otherwise do a standard redirect including the URI. Here's the iRule I built and a sample of the elements in my data group.
When I run traffic through the iRule it shows that srcLocBoolean = 0 and $destLoc is NULL
What am I missing?
===== iRule ===== when HTTP_REQUEST { log local0. "Entering iRule" set incomingURI [string tolower [HTTP::uri]] log local0. "iRule incoming URI = $incomingURI" set destLoc [class match -value -- $incomingURI contains DG_Redirects] set srcLocBoolean [class match $incomingURI contains DG_Redirects] log local0. "iRule class Match Boolean = $srcLocBoolean" log local0. "iRule Destination Location = $destLoc" if { $srcLocBoolean eq "1" } then { log local0. "iRule Redirecting [HTTP::host][HTTP::uri] to $destLoc" HTTP::redirect $destLoc
} else { HTTP::redirect [HTTP::uri] } }
===== Data Group element ===== "; := ";, "; := ";,