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....
Michael_Yates
Sep 29, 2011Nimbostratus
Hi Eric,
Depending on which BIG-IP version you are running on:
v9.x.x use "matchclass" and change your variable to $::variable
v10.x.x use "class match" and leave the "$::" off.
I would suggest renaming your Data Group and remove the "-" character or you might run into some strange behavior. I would suggest using Underscores or Periods as separators.
when HTTP_REQUEST {
if { [string tolower [HTTP::path]] contains "/ws/test.asmx" } {
if { ([matchclass [IP::client_addr] equals poolA-AllowList])} {
pool pool.fi.dev.gmacmbond.com.7172
log local0. "Permitted: [IP::client_addr] --> [HTTP::host][HTTP::uri]"
}
if { ([matchclass [IP::client_addr] equals poolB-AllowList])} {
pool pool.fi.dev.gmacsolutions.com.7173
log local0. "Permitted: [IP::client_addr] --> [HTTP::host][HTTP::uri]"
}
else {
discard
log local0. "Denied: [IP::client_addr] --> [HTTP::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