Forum Discussion
wilcdr
Nimbostratus
Nov 02, 2017Dynamically creating static variables per virtual server
Not sure if this is something that can even be done but I can't get it to work.
I'm trying to create an iRule that I can generically use to attach to an undefined number of VIPs and I need to have ...
Stanislas_Piro2
Cumulonimbus
Nov 03, 2017look at this article about Some iRule commands temporarily suspend iRule processing
if you change the value every multiple times an hour, table may be a good solution. if this value is changed less than once an hour, the static value is still the best solution.
you can use array to store this variable
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/changeVariable" } {
set VIPName [string tolower [URI::query [HTTP::uri] VIPName]]
set static::myVar(/Common/${VIPName}) foo
log local0. "Variable name = static::myVar(/Common/${VIPName})"
log local0. "value = $static::myVar(/Common/${VIPName})"
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
