STATS::set

Description

Sets the value of the specified setting (field), in the specified Statistics profile, to the specified value. If you do not specify a value, the BIG-IP system sets the value to 0.

Syntax

STATS::set <profile> <field> [<value>]

STATS::set <profile> <field> [<value>]

  • Sets the value of a Statistics profile field.

Examples

when HTTP_REQUEST {
  if {[string tolower [HTTP::uri]] starts_with "/enable"} {
    STATS::set stats_profile_1 "my_first_field" "val1"
  }
}

# Workaround for CR117956 (see version specific notes below for details)
# From Deb in this post: http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=32628#32654

when RULE_INIT {
   set ::stats_rst 1
}
when CLIENT_ACCEPTED {
   if { $::stats_rst == 1 }{
      STATS::set profilename fieldname 0
      set ::stats_rst 0
   }
}