Why do we need an expression evaluator tool in-built in NetScaler appliance Graphical User Interface (GUI) when we have http clients to assess the requests and responses?

Traditionally, this is how we evaluate the expressions:

  1. Configure the virtual servers, services, policies and actions on the NetScaler appliance
  2. We associate action with policy, bind the services to the virtual servers and the policies to the virtual servers
  3. Generate a request using an HTTP client
  4. To understand if policy hit true or false you look at the hit count on the NetScaler appliance

These sums up to total 4 steps!

The fact is, using HTTP clients along with the rest of the configuration, it is really time consuming, just to evaluate an expression! If you come to think of it, would you really want use the production NetScalers to evaluate expressions in this traditional way.

Advanced expression evaluator, not only provides a way to assess the policies, but also provides a more granular level evaluation. Using this you can evaluate a part of a complex expression, which is not provisioned by any other tool available in the market till date. You will find more details on how this is done in the latter part of the blog.

Now, let’s see how we make it easy using the advanced expression evaluator 🙂

Note that, we have used all the above 4 steps just to check if the expression is returning the right result or not!

With the advanced expression evaluator, you need to do the following step:

  1. Write the expression for any policy and click “Evaluate” to evaluate the expressions just before creating these policies and actions.

You can see how those 4 steps came down to only one step to evaluate the expressions.

The expression evaluator gives you the power to evaluate the expressions dynamically before actually deploying the policies. It eradicates the need to go through multiple steps to realize if the expression is evaluating to be correct or not.

This tool helps simulate a client inside the NetScaler appliance and process the request or response as the packet engine would have processed as a real request or response received by the appliance.

Use Case

Let’s walk through a use case and see how this process is made faster. In this case, we are evaluating the expression while creating a rewrite policy.

After writing the expression, directly click “Evaluate”.

After clicking evaluate, an “Advanced Expression Evaluator” window opens.

Note that we haven’t written the whole expression of the policy yet. We are just evaluating “HTTP.REQ.HEADER(“Host”)” part of the “HTTP.REQ.HEADER(“Host”).TYPECAST_IP_ADDRESS_T.EQ(” expression of the policy.

This is the beauty of the advanced expression evaluator. It gives you the power to evaluate even the smaller parts of the whole expression right there and then!

Come to think of it, you really cannot evaluate at this level, even using an http client!

To evaluate the expression, enter the desired “HTTP Request data” and click “Evaluate” to see if it returns the “Host” string value. As can be seen, it returns HTTP.REQ.HEADER(“Host”)” result as “”.

Note that, the “Advanced Expression Evaluator” is provisioned for every feature of NetScaler which involves configuring advanced expressions. For rewrite actions there is separate evaluator called the “Rewrite Action Evaluator”, which evaluates the rewrite action after the action is created, unlike advanced expression evaluator.

More details on Action evaluator will be covered in upcoming next week’s blog.