Forum Discussion
David_Stout
Nimbostratus
Oct 31, 2012TCL error - Can't read variable
I am trying to re-write some iRules for CMP by removing the global variables however I'd like to know why I am getting this error. I'm not a complete TCL expert so some assistance is appreciated. ...
nitass
Employee
Oct 31, 2012i understand variable which is defined in RULE_INIT will be treated as global variable. so, we have to use $:: when referencing. what Steve suggested is totally right.
[root@ve10:Active] config b rule myrule list
rule myrule {
when RULE_INIT {
set org "test"
}
when HTTP_REQUEST {
log local0. "\$::org is $::org"
}
}
[root@ve10:Active] config cat /var/log/ltm
Oct 31 21:23:59 local/tmm info tmm[7926]: Rule myrule : $::org is test
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