Forum Discussion

Sam_Hall's avatar
Sam_Hall
Icon for Nimbostratus rankNimbostratus
Aug 30, 2013

Is there some sort of an iRule "include" statement?

What I'm looking for is a way to include library style iRules so I can maintain changes to reused iRule code in a single place.

 

5 Replies

  • You can simulate reusable code by separating it into different iRules. You can have multiple iRules of the same event and order them using priority. Then whenever you need to update your iRule, all the virtual's using it will update themselves when you save the changes.

     

    when HTTP_REQUEST priority 300 {
        reusable code
    }
    when HTTP_REQUEST priority 500 {
        normal code
    } 
  • As of 11.3 you can you functions as I recall. Functions are globally available, so you can have one iRule where functions are defined.

     

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account

    Procs are indeed how you would do this, and are new and awesome as of v11.4:

     

    There will be lots more information and examples in coming weeks, so keep an eye out. ;)

     

    Colin