Forum Discussion
Are variables permeable across calls to the same iRule?
To answer your question: Variables are local and session based by default.
See https://devcentral.f5.com/s/articles/getting-started-with-irules-variables-20403
"Local Variables
All variables, unless otherwise specified, are created as local variables within an iRule. What does that mean? Well, a local variable means that it is assigned the same scope as the iRule that created it. All iRules are inherently session based, and as such all local variables are session based as well. This means that the session dictates the memory space for a given iRule's local variables and data. For instance, if connection1 comes in and an iRule executes, creating 5 variables, those variables will only exist until connection1 closes and the session is terminated on the BIG-IP. At that time the memory allocated to that flow will be freed up, and the variables created while processing that particular session's iRule(s) will no longer be accessible."
However, why not just change the ASM policy? You can disable the "Host header contains IP address" violation for this policy.
So by what you are saying, my variable would have different values each based on the specific session?
About your question on ASM and the policy, I wish :) It's a corporate standard applied on all ASM and they don't want to deviate for particular cases :/ That would be too simple.
Thanks again.