Forum Discussion
sbrudolf1_14757
May 22, 2014Nimbostratus
Trouble with Exclusion URI iRule
I am trying to write an iRule that disabled APM if it see's a uri and does not see a session already exists. I have a working iRule of the opposite but i can't seem to get this working properly. Did ...
- May 27, 2014
Your latest iRule contains a capital letter in your match string. It'll never match since you are converting to lower case before comparison.
Matt_Breedlove_
May 23, 2014Nimbostratus
Try this instead
when HTTP_REQUEST {
if { ( [string tolower [HTTP::uri]] starts_with /uri1* ) and not ( [HTTP::cookie exists MRHSession] ) } {
ACCESS::disable
} else {
ACCESS::enable
return
}
}
or try this using the sexy switch instead of if. It is way hotter and more performant
switch -glob [string tolower [HTTP::uri]] {
/uri1* { if { [HTTP::cookie exists MRHSession] } {
ACCESS::enable
return
} else {
ACCESS::disable
}
}
}
You could also swith the if to the negative/unless form if it is logically needed in the switch
Hope this helps
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