Identifying hits to the iRule.

Folks, how can I check the hits to a VIP that are being handled by the configured iRule? Also, what debug steps can help me find how how the iRule is handling the traffic?

Thanks, Nik

You can use log statements in the iRule, which will send output to /var/log/ltm

log local0.debug "text"

A common method is to use a debug variable, so you can turn it on and off easily

At the beginging of the rule

when RULE_INIT {
    set static::debug 1
}

and then in your code blocks

if { $static::debug >= 1 } { log local0.debug "Text" }

change the static::debug to 0 in RULE_INIT to shut off logging, use values greater than 1 for more verbose levels and so on.

You can also view iRule event hits from the GUI on a v11 system. Go to Statistics - Module Statistics - Local Traffic. Under the Statistics Type drop down, select iRules.