I added a logging method, a set of [] to get the rule to be valid, and put in the real pool names/member ip's. Also tried with "contains" vs "starts with".
when HTTP_REQUEST {
set the URL here, log it on the response
set url [HTTP::header Host][HTTP::uri]
set vip [IP::local_addr]:[TCP::local_port]
if {[class match [string tolower [HTTP::uri]] starts_with DGI_Pool_A]}{
pool A
}
elseif {[class match [string tolower [HTTP::uri]] starts_with DGI_Pool_B]}{
pool B
}
elseif {[string tolower [HTTP::uri]] starts_with "/admin/"} {
pool B member 1
}
elseif {[string tolower [HTTP::uri]] starts_with "/pdf/*"}{
[HTTP::uri] [string range [HTTP::uri] 4 end]
pool C
}
}
when HTTP_RESPONSE {
set client [IP::client_addr]:[TCP::client_port]
set node [IP::server_addr]:[TCP::server_port]
set nodeResp [HTTP::status]
log connection info
log local0.info "Client: $client -> VIP:$vip $url -> Node: $node with response $nodeResp"
}
ltm data-group internal /Common/DGI_Pool_A {
records {
/aboutus/careers {
data /aboutus/careers
}
/aboutus/environment {
data /aboutus/environment
}
/aboutus/export {
data /aboutus/export
}
/news/events {
data /news/events
}
/news/graphics {
data /news/graphics
}
}
type string
}
ltm data-group internal /Common/DGI_Pool_B {
records {
/app_themes {
data /app_themes
}
/authorized_use_policy {
data /authorized_use_policy
}
/cloud-overview {
data /cloud-overview
}
/cms {
data /cms
}
/customersuccesses {
data /customersuccesses
}
/device-cloud-terms-of-service {
data /device-cloud-terms-of-service
}
/dmca_statement {
data /dmca_statement
}
/en {
data /en
}
/industries/ {
data /industries/
}
/legal {
data /legal
}
/new/prindex {
data /new/prindex
}
/news {
data /news
}
/privacy {
data /privacy
}
/products-overview {
data /products-overview
}
/scriptresource.axd {
data /scriptresource.axd
}
/services-overview {
data /services-overview
}
webresource.axd {
data webresource.axd
}
}
type string