A couple weeks ago I started sending out tips for iRules users via twitter.  I created a hashtag: #iRulesTips and I've been passing out tidbits of iRules advice / info on a pretty regular basis. The goal is to post something daily (or a couple times a day) but with the way things are going around here (see: super busy), I'm happy with "almost daily". Jason even saw fit to chime in with his own contribution, which is awesome. I'm hoping more people will add their own tips, tricks and advice as they see fit.


Here's a roundup of the tips that have been sent out so far:


#iRulesTips - [string match "/*/index.html"] is likely greedier than you think. It's not going to limit things to a single layer of dirs.

#iRulesTips - list statements passed to string map rock. Something like [string map [list $find $replace] $data]

#iRulesTips - Know your event context. My recent doc made me think of this. Some commands behave differently for client vs. server context

#iRulesTips - HTTP::host and other such commands are references to a memory location, not queries. They're less overhead than variables.

#iRulesTips - This STREAM:: commands make the already hawesome stream profile infinitely more flexible. Way preferred to manual replacement (Yes, that should have been "the", not "this")

#iRulesTips - the GTM whereis command options country & continent return both in a list prior to v10. Use lindex to extract each. (From citizen_elah)

#iRulesTips - You can log directly to a remote log server via UDP by using - log [:port] [.]

#iRulesTips - Using iRules with the stream profile is amazingly powerful. Custom sub strings, toggling replacement, etc. take good to great.

#iRulesTips - new in v.10! The new after command rocks socks. Check it out: after