Forum Discussion
Jun 16, 2011
Are there functions or methods we can create using IRules?
Hello Community, I have multiple IRules associated to a VS and was wondering if there can be IRules or methods/functions that we can create and call them ONLY when we want? Or does all the IRules...
hoolio
Cirrostratus
Jun 16, 2011Hi TRX,
You can disable events using 'event < name > disable' but that affects all iRules on the virtual server which reference that event. I think the best solution is to use one or more local variables to track which code you want to run. A local variable is accessible across all iRules on the same virtual server on a per connection basis. So you can use something like:
rule1 - set run_rule3 1
rule2 - set run_rule3 0
rule3 - if {$run_rule3 == 1}{ do something}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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