Forum Discussion
Mark_Moseley
Nimbostratus
Nov 14, 2005Predefining variables and how iRules work
Hi. This is a two-parter, neither of which I can find answers for but might be using the wrong search terms (in which case, my apologies).
1) Is it possible to pre-define variables in iRules...
Mark_Moseley
Nimbostratus
Nov 14, 20051) Excellent, this is perfect. I hadn't looked at data groups for this, since they don't appear to allow for non-scalar datatypes. Am I wrong? I'm using a couple of arrays with names (extracted from the hostname) as keys, which looks to be beyond what you can put into a data group. But being able to put it into the INIT event is perfect. There's no terrible overhead there? The actual data is pretty small, probably no more than a 10K altogether. There's just a bunch of them.
2) This is all good info. One question springs to mind though, related to what you said about creating variables. Is it a safe generalization to say that for maximum performance, you should always use the functions like [HTTP::path] instead of assigning that to a variable and using the variable? I'd figured that accessing the variable would always be better (assuming you're looking at it more than once of course), just to save the overhead of calling a function/method/subroutine. In the iRules I'm thinking of, something like HTTP::path would get referenced 2 or 3 times. Would [HTTP::Path] be preferable to a variable in that case?
Thanks!
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
