Forum Discussion
RULE_INIT
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 is modified. Specify this event to initialize global variables used inside iRules."
http://devcentral.f5.com/wiki/defau..._INIT.html
I also read some few articles that any variables declared in this event are automatically global and that global variables has issues in F5 version 10 due to CMP (ie. Global variables exist within a single TMM).
So my question is when you first create and save an iRULE and has the event RULE_INIT, would it automatically load the global variable in the TMM?
Also, I also read about the use of "static" that could potentially fix the CMP issue, would that mean that once I created and save the iRULE, it would load the global variable in memory.
So in theory, I can just create one iRULE with the event RULE_INIT and load all my "static" global variables there once without referencing the iRULE to any virtual server. Then never have to put the RULE_INIT in any iRULES I have in the future?
Thanks.
- Chris_MillerAltostratusGood explanation Aaron! The wiki article explained it relatively well but I was definitely confused about whether the rule had to be applied to a Virtual Server too.
- Stevenson_88156NimbostratusThank you very much Aaron. That really cleared a lot of things up about RULE_INIT and static global variables.
- Kevin_Davies_40Nacreous
Hi Guys,
Case 3.
Case 4.
- hooleylistCirrostratusHi Kevin,
- Kevin_Davies_40Nacreous
Aaron,
- hooleylistCirrostratusPlease do!
- Kevin_Davies_40NacreousDone. Please have a look over the Wiki update for accuracy.
- hooleylistCirrostratusThanks for updating the RULE_INIT page. No, global variables aren't synched to a peer unit as they're not part of the session table.
Recent Discussions
Related Content
* 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