Forum Discussion
Robert_47833
Jun 15, 2012Altostratus
3 irules order
hello,dear irule
I met an headache stuff recently
there is one VIP which has irule 1 ,irule 2 and irule 3 assigned to it
1:I 'd like to use some syntax ...
hooleylist
Jun 15, 2012Cirrostratus
Hi Robbie,
You could set a local variable in Rule1 which Rule2 and Rule3 check before executing their code. Or you could combine the iRules into one if that makes sense for the logic. Here's a simple example:
rule rule1 {
when CLIENT_ACCEPTED {
if {$some_check==1}{
set run_other_rules 1
} else {
set run_other_rules 0
}
}
}
rule rule2 {
when CLIENT_ACCEPTED {
if {$run_other_rules==1}{
Exit this event in this rule
return
}
}
when HTTP_REQUEST {
if {$run_other_rules==1}{
Exit this event in this rule
return
}
}
}
rule rule3 {
when CLIENT_ACCEPTED {
if {$run_other_rules==1}{
Exit this event in this rule
return
}
}
}
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