Forum Discussion
Simon_Knox_1115
Nimbostratus
Jul 08, 2005HELP! hanging iRule
Hi,
I've recently converted from 4.5 to 9.05 and converted my iRules, using OTCU then tweaking so they are correct (at least what I though was correct).
When connecting to a web site...
unRuleY_95363
Jul 11, 2005Historic F5 Account
Another thing worth noting is that the "not" operator is of higher precendence that it used to be in 4.x (basically 4.x did a better job of figuring out what you wanted to do, but because we are using Tcl now, we don't have that same flexibility with the precedence of the operators). So, make sure you add parenthesis around the expression that is the target of the not operator, as in:
elseif { not ( [TCP::client_port] == "80" ) or not ( [TCP::client_port] == "8001" ) or
not ( [TCP::client_port] == "8099" ) or not ( [TCP::client_port] == "8003" ) or
not ( [TCP::client_port] == "8004" ) or not ( [TCP::client_port] == "8005" ) or
not ( [TCP::client_port] == "8006" ) or not ( [TCP::client_port] == "8007" ) or
not ( [TCP::client_port] == "8008" ) } {
I would also suggest using a class to help minimize the number of these tests as in:
class server_ports {
80,
8001,
8099,
8003,
8004,
8005,
8006,
8007,
8008
}
and then modify your last elseif to be:
elseif { not [matchclass [TCP::local_port] equals $::server_ports] } {
You can also use citizen_elah's example above which relies even more on the class (you may want to add a test of $match to make sure a match was found before do the "pool node-$match" though).
Hope this all helps.
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
