Forum Discussion

Jonas_Karlsson1's avatar
Jonas_Karlsson1
Historic F5 Account
Feb 09, 2005

How to controll in what order rules are evaluated?

Hi,

 

 

I'm looking for a way to control in what order iRules are evaluated.

 

 

I have a number of small code pieces, all of them using the same event, that I would like to use in various combinations on different virtual servers. It would be much neater to specify in what order they should be evaluated when I assign them to the VS instead of combining those I need to one huge rule.

 

 

Think I have seen something like this once but can't find it when I need it.

 

 

Cheers

 

 

Jonas
  • I know this is an old thread, but it was very helpful to me. FYI, the priorities are 0 to 1000 not 1 to 1000. Also, it seems that there is actually 3 levels:

     

     

    - priority of the event (defined with each When block)

     

    - priority of the iRule itself (when created via iControl)

     

     

    Also, through experimentation, it looks like the priority of the iRules within a virtual server is changed when you use the UI to change the ordering.

     

     

    //Joe
  • When more than one iRule is configured on the virtual you can do this

    user@(ltm_name)(...)(tmos) ltm virtual
    user@(ltm_name)(...)(tmos.ltm.virtual) list target_virtual_name rules
    ltm virtual target_virtual_name {
        rules {
            irule_name_1
            ...
            irule_name_2
            irule_name_n
        }
    }
    user@(ltm_name)(...)(tmos.ltm.virtual) modify target_virtual_name rules { irule_name_1 irule_name_2 ... irule_name_n }
    

    I show the list so that you can review the current order.