Forum Discussion
Mark_Stradling_
Jan 07, 2016Cirrus
iRule Clean up: How to audit unused conditions?
I am trying to set up a system to audit iRule conditions. After years of building on an iRule, eventually some of the conditions fall out of use and developers are not always great about telling me w...
Kai_Wilke
Jan 07, 2016MVP
Hi Mark,
when using
[switch]
based iRules, there is unfortunatly no way to trace which part of the multiple conditions has been triggered. All you can do is to split those multiple conditions into individual conditions and then copy/paste the desired actions and also use different [ISTATS]
keys as a counter.
Note: In TCL v8.5 (aka. LTM uses still TCL v8.4) there will be a new feature to store the matches in
mode. But even then you don't want to use -regexp for perfomance reasons, isn't it? 😉[switch -regexp]
But when using
[IF]
you could use the following syntax to see which part of a multiple conditions has been triggered.
if { ( [HTTP::uri] starts_with [set y "/test1"] ) or
( [HTTP::uri] starts_with [set y "/test2"] ) or
( [HTTP::uri] starts_with [set y "/test3"] ) or
( [HTTP::uri] starts_with [set y "/test4"] ) or
( [HTTP::uri] starts_with [set y "/test5"] ) } then {
} else {
set y "else"
}
I'm sorry... 😞
Cheers, Kai
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