Example of Static Variables with Virtual Server specific settings
Problem this snippet solves: When you have an iRule that requires some virtual server specific "setting" that is configured in RULE_INIT; unless you have a different version of the iRule for each vi...
Published Sep 11, 2020
Version 1.0Chad_Jenison
Nimbostratus
Joined May 13, 2008
Chad_Jenison
Nimbostratus
Joined May 13, 2008
Kai_Wilke
Jan 20, 2023MVP
Hi Chad,
you may think about using static::array() variables. Much cleaner for such usecases...
when RULE_INIT {
set static::virtualLimit(http_test) "25"
set static::virtualLimit(https_test) "50"
}
when HTTP_REQUEST {
HTTP::respond 200 content "OK - Limit Variable = $static::virtualLimit([URI::basename [virtual]])"
}
Cheers, Kai