Forum Discussion
Mar 18, 2011
local vs. global variables scenario question
Hello Community,
If a local variable is set to "0" in the request event, then changed to 1 due to some logic, the very next time the even executes again the variable will set back to "0". The goal is keep the variable at it's current value state and NOT be reset. How would one resolve that issue without global variables?
Regards,
TRX
2 Replies
- hoolio
Cirrostratus
Hi TRX,
How about setting the local variable to 0 in CLIENT_ACCEPTED and then modifying it to 1 in HTTP_REQUEST only if some condition is true? That would be valid for the life of the TCP connection. If you want to have the variable available for all connections globally, you could use a subtable to hold the value.
http://devcentral.f5.com/wiki/default.aspx/iRules/table
Aaron - Thanks Aaron. You are good man.
Regards,
TRX
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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