Forum Discussion
TeDZzz
Nimbostratus
Oct 28, 2018irule unlike TCL regarding the specification of the body of when and if
How does the irule snippet below work when the left curly brace that starts the body of the when and if are after a newline. In TCL, this would generate an error, but the irule editor accepts it.
when HTTP_REQUEST
{
if { [HTTP::uri] starts_with "/m" or [HTTP::uri] starts_with "/v/" or [HTTP::uri] starts_with "/Z" or [HTTP::uri] starts_with "/p"}
{
do something
- Kevin_Stewart
Employee
It is by convention more than anything that TCL requires the grouping brace { to be on the same line as the object it's grouping for. But you can always use line continuation if this doesn't appeal to you.
if { $var == 1 } \ { log local0. "match" }
I'd probably argue at this point that you've only made it more difficult to read.
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