Forum Discussion
Srinivasan_G_31
Oct 29, 2012Nimbostratus
iRule assistance - Combining iRules
Hi,
I want to combine following 2 iRules into 1. Please assist.
iRule 1
----------
when HTTP_REQUEST {
if { [HTTP::uri] contains "/abcd/" } {
pool abcdpool member 1.1.1.1 80
}
}
iRule 2
----------
when HTTP_REQUEST {
switch -glob [HTTP::path] {
"*[0-9][0-9][0-9][0-9]*" { pool abcdpool member 1.1.1.1 80
default abcdpool }
}
}
- hooleylistCirrostratus
You can combine the two iRules to avoid any conflicts:
Aaronwhen HTTP_REQUEST { switch -glob [HTTP::path] { "*/abcd/*" - "*[0-9][0-9][0-9][0-9]*" {pool abcdpool member 1.1.1.1 80} default {pool abcdpool} } }
- Srinivasan_G_31Nimbostratus
Hi Aaron,
Can i also include ".aspx" at the end of the numerics to be matched?
Like "*[0-9][0-9][0-9][0-9].aspx*". Is this the right syntax?
- Mohamed_LrhaziAltocumulusYes.
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