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
I could not get the nested if statements to work. However, by creating two separate iRules, and applying each to the VS, I was able to get the logic to work.
Virtual Server xyz.com iRules
First: iRule_poolA
Second: iRule_poolB
iRule_poolA
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][IP::client_addr] --> [HTTP::header host][HTTP::uri]" }
}
}
iRule_poolB
when HTTP_REQUEST {
if {
[string tolower [HTTP::path]] contains "/ws/test.asmx"
} { if { ([matchclass [IP::client_addr] equals poolB.AllowList])} {
use pool poolB
log local0. "Permitted (poolB): [IP::client_addr][IP::client_addr] --> [HTTP::header host][HTTP::uri]"
} else {
discard
log local0. "Denied (poolA and poolB): [IP::client_addr] --> [HTTP::header host][HTTP::uri]" }
}
}
Any ideas why this doesn't seem to work by combining both iRules into a single iRule?
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