Forum Discussion

Ken_Chan_95250's avatar
Ken_Chan_95250
Icon for Nimbostratus rankNimbostratus
Jun 04, 2008

order of irules

Hi ,

 

 

If i have a few irules which use WHEN HTTP_REQUEST , HTTP_RESPONSE and HTTP_RESPONSE_DATA ... and i put all of them to the same virutal server. How will those irules be execused ? as I have written some filter rules for different purpose and so I won't want to make all of them into the same irules so as to easier manage what filter to apply to different virtual servers ...

 

 

Thank you for your time to read my question ..

 

 

Best Regards,

 

 

Ken
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    The iRule wiki has a page on events you can reference (Click here).

     

     

    Event code is triggered as the event occurs. The events are triggered based on profiles on the VIP. For a standard VIP with a TCP and HTTP profile, the following events could be triggered (Click here:

     

     

    Request events:

     

    ---------------------------------------------

     

    CLIENT_ACCEPTED - clientside - triggered when LTM receives and accepts a connection from a client

     

    HTTP_REQUEST - clientside - triggered when an HTTP profiles

     

    HTTP_REQUEST_DATA - clientside - triggered if HTTP::collect was called in HTTP_REQUEST

     

    LB_SELECTED - clientside - triggered when a node has been selected per the load balancing algorithm

     

    LB_FAILED - clientside - triggered when a node couldn't be selected or isn't reachable

     

    SERVER_CONNECTED - serverside - triggered when a connection is established with the node

     

    HTTP_REQUEST_SEND - serverside - triggered when LTM sends the HTTP request to the node

     

    CLIENT_CLOSED - clientside - triggered when the client connection is closed

     

     

    Response events:

     

    ---------------------------------------------

     

    HTTP_RESPONSE - serverside - triggered when LTM receives the HTTP response from the node

     

    HTTP_RESPONSE_DATA - serverside - triggered if HTTP::collect was called in HTTP_RESPONSE

     

    SERVER_CLOSED - serverside - triggered when the server connection is closed

     

     

    If you have multiple instances of the same event in different rules on the same VIP, then priority comes into play. unRuleY gave a good explanation of priority in this post (Click here). By default all events have a priority of 500. You can manually specify a priority for an event using 'when EVENT_NAME priority PRIORITY_NUMBER' with the priority value being 1 to 1000. The lower the priority value, the higher the precedence for event evaluation. If two events have the same priority in two different rules, the rule which is listed first in the VIP configuration will be evaluated first.

     

     

    If you want more specific suggestions for your scenario, try posting the rules you're working with.

     

     

    Aaron
  • Yes, Aherrman is correct. I have a few irules which use HTTP_REQUEST event and so I want to know how F5 handel those irules .. and I may have different irules for HTTP_REPONSE_DATA in future and so I want to know how will it behave ... If any one has more idea. pls let me know . many thx ..

     

     

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus

    If you have multiple instances of the same event in different rules on the same VIP, then priority comes into play.

     

     

     

    See the last paragraph for details on how multiple iRules with the same events are handled. You can also check this post for some examples of using priority:

     

     

    http://devcentral.f5.com/default.aspx?tabid=53&view=topic&forumid=5&postid=17981801

     

     

    Aaron