Forum Discussion
Tony_Hobson_189
Jun 10, 2015Nimbostratus
Variable Scope in iRules
Hello
I’ve got a quick question regarding variables in iRules. I would like to set variables to use across different functions in an iRule but struggling to find out what I need to do to make a va...
mikeshimkus_111
Jun 10, 2015Historic F5 Account
You can use static to set it when the rule initializes: https://devcentral.f5.com/wiki/iRules.static.ashx
when RULE_INIT {
set static::TEST 0
}
when HTTP_REQUEST {
if { $static::TEST } {
do something
}
}
When HTTP_RESPONSE {
if { $static::TEST } {
do something
}
}
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