What could you do with your code in 20 Lines or Less? That's the question I ask (almost) every week for the devcentral community, and every week I go looking to find cool new examples that show just how flexible and powerful iRules can be without getting in over your head.

Digging through the forums this week has been rewarding. There are a ton of people out there writing cool iRules, some big, some small, but all cool and good to see. The few chosen for the 20lol this week are all interesting takes on problems we’ve seen before.

Cross Server Persistence:


First we have an example of adding persistence to an application flow that deals with multiple services. This isn’t a typical persist add, as it’s dealing with Link Controller, so we’re really trying to “persist” by ensuring the same address is assigned each time. This example is being a bit trickier than your average bear by using the session table to store the data necessary and look it up on each new client connection. This is really done in two different iRules, but even together they’re less than 20 lines.