Forum Discussion
Eric_Frankenfie
Sep 29, 2011Nimbostratus
Parsing URI to Make Pool Selection
I am trying to write an iRule which will read in a URI and then based on what it finds match the source IP address to data lists to make the pool selection. For example... URL: www.example....
Eric_Frankenfie
Oct 27, 2011Nimbostratus
Solved!
I was using an 'if' statement for the second Data Group List where I should have been using a 'elseif' statement.
Here is the final iRule for reference.
when HTTP_REQUEST {
if { [string tolower [HTTP::path]] contains "/ws/test.aspx" } {
if { ([matchclass [IP::client_addr] equals poolA.AllowList])} {
use pool poolA
log local0. "Permitted (poolA): [IP::client_addr] --> [HTTP::header host][HTTP::uri]"
} elseif { ([matchclass [IP::client_addr] equals poolB.AllowList])} {
use pool poolB
log local0. "Permitted (poolB): [IP::client_addr] --> [HTTP::header host][HTTP::uri]"
}
else {
discard
log local0. "Denied (poolA/poolB): [IP::client_addr] --> [HTTP::header host][HTTP::uri]" }
}
}
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