Configure advanced policy expressions outside the context of a policy
A number of functions, including the following, can require an advanced policy expression that is not part of a policy:
Integrated Caching selectors:
You define multiple non-compound expressions (selectlets) in the definition of the selector. Each selectlet is in an implicit logical AND relationship with the others.
You configure an expression for the TOKEN method of load balancing for a load balancing virtual server.
Expressions define the location of the rewrite action and the type of rewriting to be performed, depending on the type of rewrite action that you are configuring. For example, a DELETE action only uses a target expression. A REPLACE action uses a target expression and an expression to configure the replacement text.
You use advanced policy xpressions to configure Limit Selectors. You can use these selectors when configuring policies to throttle the rate of traffic to various servers. You define up to five non-compound expressions (selectlets) in the definition of the selector. Each selectlet is in an implicit logical AND with the others.
Configure an advanced policy expression outside a policy by using the CLI (cache selector example)
At the command prompt, type the following commands to configure an advanced policy expression outside a policy and verify the configuration:
- add cache selector \<selectorName\> \<rule\> - show cache selector \<selectorName\>
> add cache selector mainpageSelector "http.req.cookie.value(\"ABC_def\")" "http.req.url.query.value(\"_ghi\")"selector "mainpageSelector" added Done > show cache selector mainpageSelector Name: mainpageSelector Expressions: 1) http.req.cookie.value("ABC_def") 2) http.req.url.query.value("_ghi") Done
Following is an equivalent command that uses the more readable q delimiter, as described in Configure advanced policy expressions in a policy:
> add cache selector mainpageSelector2 q~http.req.cookie.value("ABC_def")~ q~http.req.url.query.value("_ghi")~selector "mainpageSelector2" added Done > show cache selector mainpageSelector2 Name: mainpageSelector2 Expressions: 1) http.req.cookie.value("ABC_def") 2) http.req.url.query.value("_ghi") Done