Forum Discussion
Dan_Ecott_19303
Nimbostratus
Jan 04, 2007Help with v9 conversion of iRule
Can anyone help with this iRule conversion I need to sort out.
Here is the old V4.x rule I was using. It simply does case matching for all possible URIs.
-----------------------8<-...
hoolio
Cirrostratus
Jan 05, 2007This should be equivalent for 9.x:
if { [HTTP::uri] matches_regex "^/[-a-zA-Z0-9_/]{1,35}\.[a-zA-Z0-9]{1,5}$" \
&& [HTTP::host] matches_regex "^[-a-zA-Z0-9\._]{1,30}(\:[0-9]{1,5})?$"}{
pool web_seal_pool
}
elseif { [HTTP::uri] matches_regex "^/[-a-zA-Z0-9_/]{1,100}\.[a-zA-Z0-9]{1,5}$" \
&& [HTTP::host] matches_regex "^[-a-zA-Z0-9\._]{1,100}(\:[0-9]{1,5})?$" }{
pool web_seal_pool
}
As the action is the same for either pair of conditions, you could combine them:
if { ([HTTP::uri] matches_regex "^/[-a-zA-Z0-9_/]{1,35}\.[a-zA-Z0-9]{1,5}$" \
&& [HTTP::host] matches_regex "^[-a-zA-Z0-9\._]{1,30}(\:[0-9]{1,5})?$" )
or ( [HTTP::uri] matches_regex "^/[-a-zA-Z0-9_/]{1,100}\.[a-zA-Z0-9]{1,5}$" \
&& [HTTP::host] matches_regex "^[-a-zA-Z0-9\._]{1,100}(\:[0-9]{1,5})?$") }{
pool web_seal_pool
}
Aaron
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