Forum Discussion
Unset a static variable
Thanks for the response. I'm not sure I understand your first question. If we add a domain to the data-group, we generally see requests for the new 'bad domain' do not match the condition. We see the similar behavior when we remove a 'bad domain'. I assume this is a result of using a static variable which only updates during initiation of the iRule (or unsetting). I don't know the best way to force it to update, though. I've had limited success unassigning the iRule.
I've never used a static before; If I were writing it myself, I would just reference the data-group directly in the 'if' condition. I believe a static was used because the data-group is only modified once a month. Additionally, it is applied to a high volume website so I assume there are some efficiencies in using a static.
I was using curl to test, so I did confirm the behavior occurs with new connections, but I will do some more testing with a log statement similar to what you provided. I wasn't sure the best way to get insight into the data-group and static.
Thanks
Sorry for the inconvenience.
The RULE_INIT event is in a global scope, so when you declare a static variable, you are setting it for all contexts. When you update the static variable values, it should affect all running contexts when iRule is updated.
Working with local variables, usually the old connections will not take the new iRule version and values. So, only the new connections will take the new values and updates.
Furthermore, It sounds weird to me that you can not read the entries changes on the data group since you are storing the data group name reference to match that list at runtime, right?
See:
https://clouddocs.f5.com/api/irules/RULE_INIT.html?highlight=rule_init
Regards.
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