Instruction manual

Appendix A: Policy Expressions
A-14 NetScaler 9000 Series Installation and Configuration Guide - Volume 1
NSICG60_JAN05
add policy expression sess "jsession_cookie ||
jsession_query || jsession_url"
For example, if a request contains the following:
GET /test.jsp;jsessionid=123456789?jsessionid=zyxwvutsr
HTTP/1.0
Cookie: jsessionid=abcdefghi
For the above request, the buffer used for further decision making would
contain the value cdefgh. If the cookie was missing, the buffer would contain
the value xwvuts.
If the above expression was specified for token based load balancing and if
the compound expression evaluated as true, the buffer would be hashed to
create an index into the appropriate vserver service pool, and the request
would be directed to that server pool. If the rule evaluated as false, a default
load balancing metric of round robin would be used.
If this expression was specified for rule based persistence and if the rule tests
true, the value in the buffer will be used to create a persistent session entry,
which will then be associated with the server selected using the load
balancing algorithm. If the rule tests false, then the session will be load
balanced with no persistence.
When URL Passive and Custom Server ID persistence is used, the behavior is
basically the same, except the nature of the value that is expected is different.
In URL Passive, the buffer should contain a value that is equivalent to the
hexadecimal IP address and port of the service that the session should be
bound to. In the case of a custom server ID, the buffer is expected to contain
a numerical value that is assigned to a service through the parameter –serverid
in either add service or set service commands.
A.1 Using an expression in a policy definition
Policies are generally in the form : "add <policytype> policy –rule
<expression> …". A rule is nothing but an expression used in a policy. Here,
expression logic can also be directly specified in expression without having to
create a named expression. Examples are:
add filter policy filter_nonget –rule "method != get"
–reqAction RESET