Forum Discussion
Jasa_74968
Mar 25, 2014Nimbostratus
iRule to check URI and Client source IP using data groups
Hi everybody, I'm trying to achieve the following with my iRule:
1. Check for URI and if its /abc/* choose pool_A
2. Check for URI and if its /abc-preprod/* also check if Client's IP is ...
Kevin_Stewart
Mar 25, 2014Employee
A few typos:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/abc/*" {
log local0. "Detected [HTTP::uri] URL"
pool pool_A
log local0. "Production pool selected"
}
"/abc-preprod/*" {
log local0. "Detected [HTTP::uri] URL"
if { [class match [IP::remote_addr] equals internalIP] } {
log local0. "Client IP [IP::remote_addr] belongs to private network"
pool pool_B
log local0. "Pre-production pool selected"
}
} default {
discard
log local0. "Wrong URI or Client connecting to Pre-prod from external, packet discarded"
}
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects