Forum Discussion
Nick_Coelho_338
Dec 21, 2006Nimbostratus
else procedure undefined?
i have what I think is a simple iRule (i am a complete novice mind you). i can not get the else command to work. gives the following eror no matter what i do. sorry if i am just dense
010701...
Deb_Allen_18
Dec 21, 2006Historic F5 Account
In most tcl implementations both braces need to be on the same line with the "else", since the "else" is actually part of the "if" command.
In F5's tcl implementation, the "else" has to be on the same line as the leading brace, but the trailing brace may be on the next line.
Standard tcl syntax:
if { condition }{
code
} else {
code
}
Alternate F5 syntax:if { condition }{
code
} else
{
code
}
And unless your URIs consist only of the specified directories with no trailing path or filename, you will also need to wildcard your switch patterns to get the expected matches:when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/affiliates*" -
"/endpages*" -
"/friends*" -
...
HTH
/deb
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