Chris_Miller
Jul 06, 2010Altostratus
Heatmap iRule Errors
I've implemented this - http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/1084382/Heatmaps-iRules-Style-Part-1.aspxComments and am getting a few errors.
Here's the rule, slightly modified for my environment.
when HTTP_REQUEST {
if { [HTTP::header exists "True-Client-IP"] }
{ set user_ip2 [HTTP::header True-Client-IP] }
else { set user_ip2 [IP::client_addr] }
if {[HTTP::uri] starts_with "/heatmap" and [matchclass $user_ip2 equals $::whitelist]} {
set chld ""
set chd ""
foreach state [table keys -subtable states] {
append chld $state
append chd "[table lookup -subtable states $state],"
}
set chd [string trimright $chd ","]
HTML REMOVED SO DC DOESN'T PUT UP PIC
log local0. "heatmap accessed by $user_ip2"
} elseif {[HTTP::uri] starts_with "/resetmap" and [matchclass $user_ip2 equals $::whitelist]} {
foreach state [table keys -subtable states] {
table delete -subtable states $state
}
log local0. "heatmap reset by $user_ip2"
} else {
set loc [whereis $user_ip2 abbrev]
log local0. "location is $loc"
}
if {[table incr -subtable states -mustexist $loc] eq ""} {
table set -subtable states $loc 1 indefinite indefinite
}
}
This produces the following errors in logs:
TCL error: rule_heatmap - Illegal value (line 24) invoked from within "table incr -subtable states -mustexist $loc"