What could you do with your code in 20 Lines or Less? That's the question I like to ask for the DevCentral community, and every time I go looking to find cool new examples that show just how flexible and powerful iRules can be without getting in over your head.
This edition of the 20LoL is brought to you yet again by the forums and the hawesome community therein. I swear you people (and by "you people" I mean forum posting individuals) never cease to amaze me. Yes, there are some rockstars out there, but even for those that can't be the next hoolio I am consistently impressed at the questions and interaction I see between users. A little perusing brought out 20LoL worthy examples of Mod Rewrite conversions, a re-usable pool redirect, and even a pop-up window via an iRule. Too much cool stuff is quickly becoming a problem on DevCentral, and in the iRules forum in particular. It's a problem I enjoy having, and my hat is off to those of you creating said "problem"...keep it up.
As to this week's 20LoL:
Multi-use default pool redirect
First up, this seemingly simple redirect iRule has a little more going for it than meets the eye. If you take a closer look you'll see that the CLIENT_ACCEPTED section is setting up the default pool with the LB::server pool command. This means this iRule can be applied to any virtual server without modification, and it will always correctly default to the pool applied to that virtual server. A handy little trick to save some editing time and confusion.