Forum Discussion
Stevenson_88156
Jan 14, 2011Nimbostratus
RULE_INIT
Hi I am a newbie when it comes to iRULES and when I am reading the about the description for the RULE_INIT event, it says the following: "Triggered when an iRule is added or i...
Kevin_Davies_40
Dec 12, 2012Nacreous
Hi Guys,
Can you clarify some use cases for me please. My understandind is that global variables are always scoped to the virtual but I got asked the following.
Case 1.
If * separate* iRules A and B, both using the RULE_INIT event, applied to different virtual's just happen to use global variables of the same name, will one overwrite the values of the other when RULE_INIT is triggered for one of them? In other words are global variables shared across all virtual's by default or only on the virtual to which it is applied.
Case 2.
If the *same* iRule is applied across more than one virtual do all those virtual's then share the same RULE_INIT global variable space. If virtual A modifies global variable X does virtual B and C see that modification if they use the same iRule.
Case 3.
Case 2 begs the question, when you save an update to the iRule is the system saving an internal copy per virtual? In other words the globals and other variables are only scoped to that virtual.
Case 4.
If case 2 is true, does the command [virtual] have any meaning in the context of RULE_INIT. Can it be used in this event?
I'll start testing these as well.
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