Forum Discussion
iRule periodic logging
Hi Shew and welcome to Devcentral!
iRules and their variables are scoped to a connection. When an iRule event is triggered, it is per connection unless the event uses something other than TCP as the underlying protocol. Events can set variables and subsequent events can read and update them but only within the scope of that connection. Once the connection is cleaned up by the platform so is the variable space it uses. Even if the backend connections are shared each variable space is unique to the incoming connection as this is where the connection starts. There is no persistant global variable space for iRules except except when defined in the RULE_INIT event. The key thing here is they dont share varable space. In order to preserve information outside a connection you need to use mechanisims that live outside the connection.
Now what you want to do is trigger a timer and sure an iRule will do that but then so will every single connection. If you have 30 sessions all of which will start at different times they will trigger 10 seconds after when they started. As you can see, an ever shifting series of connections is not a good base for a ongong timer. There are ways to do it but the issue will be if the connections stop, the timer will stop. So let me ask you are question? What is the purpose of the timer. What are you wanting to know or to find out. What is the goal here and then we can more than likely come up with another way to achieve the outcome.
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