46

Citrix NetScaler Policy Configuration and Reference Guide

You can use parentheses to control the order of evaluation in a compound expression.

Booleans in Compound Expressions

You configure compound expressions with the following operators:

&&. This operator is a logical AND. For the expression to evaluate to TRUE, all components that are joined by the And must evaluate to TRUE. Following is an example:

http.req.url.hostname.eq("myHost") && http.req.header("myHeader").exists

. This operator is a logical OR. If any component of the expression that is joined by the OR evaluates to TRUE, the entire expression is TRUE.

!. Performs a logical NOT on the expression.

In some cases, the NetScaler configuration utility offers AND, NOT, and OR operators in the Add Expression dialog box. However, these are of limited use. Citrix recommends that you use the operators &&, , and ! to configure compound expressions that use Boolean logic.

Parentheses in Compound Expressions

You can use parentheses to control the order of evaluation of an expression. The following is an example:

http.req.url.contains("myCompany.com") (http.req.url.hostname.eq("myHost") && http.req.header("myHeader").exists)

The following is another example:

(http.req.header("Content-Type").exists && http.req.header("Content-Type").eq("text/html")) (http.req.header("Transfer-Encoding").exists http.req.header("Content-Length").exists)

Compound Operations for Strings

The following table describes operators that you can use to configure compound operations on string data.

String-Based Operations for Compound Advanced Expressions

All string operations

Operations that produce a string value

Page 60
Image 60
Citrix Systems 9.2 Booleans in Compound Expressions, Parentheses in Compound Expressions, Compound Operations for Strings