Symptoms
When you attempt to modify an existing expression using the set expression command line interface (CLI) command, you receive the following error message:
“ERROR: No support for set compound expression”
Cause
This error occurs because the expression the operator is attempting to modify is a named compound expression. NetScaler supports the following types of expressions:
Once created, named compound expressions cannot be modified.
Resolution
The best practice for using compound expressions in a policy definition is to create simple-named expressions, and then define the policy using a rule that applies the appropriate logical operators to the simple-named expressions. The following example illustrates two methods of creating a Content Switching policy that matches all request URLs containing either “index” or “home”:
Method 1 (using named compound expressions):
> add expression expr1 “REQ.HTTP.URL CONTAINS index || REQ.HTTP.URL CONTAINS home”
> add cs policy pol1 –rule expr1
Method 2 (using named simple expressions):
> add expression expr1 “REQ.HTTP.URL CONTAINS index”
> add expression expr2 “REQ.HTTP.URL CONTAINS home”
> add cs policy pol1 –rule “expr1 || expr2”
Method 2 is the best practice because the expressions can be modified after creation if required. It is not possible to modify a named compound expression after creation. If changes are required, the expression must be deleted and recreated.
Status
This behavior is by design.