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 variable available in the scope of the entire iRule. For example:
I want to set TEST once at the top of an iRule, but if I set this like shown below, I get [command is not valid in the current scope]
set TEST 1
when HTTP_REQUEST {
if { $TEST } {
do something
}
}
When HTTP_RESPONSE {
if { $TEST } {
do something
}
}
Thanks