Forum Discussion
The same static variable in different iRules/VS
- Feb 17, 2026
Hello Pytonius
static variables might became very trickySo first of irule init does not execute on a request base but every time the irule is initiated (saved, applied, etc)
That said if the last action you did was in second irule, that variable preserved
OK, that is interesting. So the most deterministic approach is to have only 1 iRule in whole system with RULE_INIT for static variable definitions (maybe not applied in any VS) and all other iRules just referencing those variables without the ambitions to change any of them. So I rather stay with local variables :-)
Thank you again, Injeyan!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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