Forum Discussion

brahim94_11525's avatar
Icon for Nimbostratus rankNimbostratus
Aug 22, 2011

Apply multiple Irule on VS with the same trigger event




I have something strange on my VS configuration. Indeed, I can apply multiple Irule with the same event (CLIENT_ACCEPTED) on one VS.



It's working without error and warning. Is it normal ? Because I know we cant use several Irule with the same Event on a VS.



Below the irule:








set ::var_test "toto"










set dn_str [class match -value [IP::local_addr] equals $::var_test ]



if { $dn_str eq "" } {


log local0. "Error"





} else {



if { $dn_type eq "toto" } {


log local0. "node"


set ip ""


node $ip



} elseif { $dn_type eq "tata" } {


log local0. "pool"


pool ::var_test



} else {


log local0. "invalid"








Thank you


2 Replies

  • Hamish's avatar
    Icon for Cirrocumulus rankCirrocumulus
    Yes. Working as designed and fully supported. In fact as you've found out already, the variables even get shared across the iRules as well (So watch out if you're using some standard naming for variables and they accidentally are the same where you expected the lexical scope to be different :)



    You can define which iRule fires first using the priority command as well on the iRule. (Which can be very important if one iRule depends on the other).



  • Another note on performance: you should try to avoid using global variables (like $::var_test) as they prevent the iRule from executing on more than one TMM instance. As Hamish said, even local variables are shared across iRules on the same virtual server. So you should be able to use a local variable if you want to share it. If you don't want to share the variable across multiple iRules, use unique variable names.