Parsing URI to Make Pool Selection
URL: www.example.com/ws/test.asmx
If URI contains "/ws/test.asmx"
If source IP address equals Pool A data list
Use Pool A
Log the request was permitted from source IP address
If source IP address equals Pool B data list
Use Pool B
Log the request was permitted from source IP address
Else
Drop request
Log the request was denied from source IP address
Here is what I have so far, but it seems that all requests are going to pool A. Any help would be greatly appreciated.
when HTTP_REQUEST {
if { [string tolower [HTTP::path]] contains "/ws/test.asmx" } {
if { ([matchclass [IP::client_addr] equals poolA-AllowList])} {
use pool poolA
log local0. "Permitted: [IP::client_addr][IP::client_addr] --> [HTTP::header host][HTTP::uri]"
if { ([matchclass [IP::client_addr] equals poolB-AllowList])} {
use pool poolB
log local0. "Permitted: [IP::client_addr][IP::client_addr] --> [HTTP::header host][HTTP::uri]"
} else {
discard
log local0. "Denied: [IP::client_addr] --> [HTTP::header host][HTTP::uri]"
}
}
}
}