79808206

Date: 2025-11-03 18:44:14
Score: 1
Natty:
Report link

Thanks, Donal.

So, I didnt code this globally. According to the doc, local vars are scoped to the connection, not the iRule. So I made 2 irules. A common one to be used by all of the virtual servers I specify, and then a very short one for each connection, that merely prefills the variables that the longer one uses. I set the one with the variable (config) definitions as higher priority. I define the variables in the CLIENT_ACCEPTED event, and dont have anything defined prior to this

I could have done it with procedures as well, but that seemed more complicated than just letting the scope of the local vars do their thing. Plus, if I did everything as procedures, that would mean all of the events would also be coded inside of my "definition" irule, so if I chose to add new events to the rules, id still have to go back and make a custom change to every single irule that is specific on a per-virtual-server basis.

I ran a half million calls through my above example with zero issues, so unless you can give me a reason not to, I'm going to do some production testing, as the way I've implemented to far gives me the most flexibility.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-1):
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: R. Smith