Forum Discussion
Joel_Moses
Nimbostratus
Dec 07, 2009Determining stats profile name for VS
Is there any way within an iRule to detect the Statistics profile set for the current VS? I'd assumed there would be a [PROFILE:: exists stats] or something similar, but there isn't. The Wiki isn't ex...
hoolio
Cirrostratus
Dec 08, 2009It would be useful to have a way to determine the name of the stats profile from an iRule. If this isn't possible, you could open a case with F5 Support and ask them to consider adding this functionality in a future release.
For now, do you want to use one stats profile per VIP? If so, you could use a naming convention based on the VIP name that would allow you to write a generic rule:
when HTTP_REQUEST {
log local0. "\[virtual name\]: [virtual name]"
log local0. "vip stats profile name: [virtual name]_stats"
log local0. "vip stats profile field1 value: [STATS::get [virtual name]_stats field1]"
log local0. "vip stats profile field1 value incr: [STATS::incr [virtual name]_stats field1]"
log local0. "vip stats profile field1 value: [STATS::get [virtual name]_stats field1]"
}
And the log output:
: [virtual name]: example.com_http_vs
: vip stats profile name: example.com_http_vs_stats
: vip stats profile field1 value: 0
: vip stats profile field1 value incr: 1
: vip stats profile field1 value: 1
If you're trying to use one stats profile on multiple VIPs, you could create a datagroup which maps the VIP name to the stats profile name. You could then use class or findclass in RULE_INIT to set the stats profile name for the particular VIP the iRule is running on.
Neither option is perfect, but they would get you around the need to hardcode the stats profile name in the iRule.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects