Applying Rules
A virtual server examines a request using TrafficScript rules to choose an action to take. Each rule examines the request, possibly modifies it, and performs a final action:
•Choose a pool to handle the request.
•Close the request.
•Log the transaction.
•Do nothing; the request is passed to the next rule in the list.
Each virtual server is associated with a “default pool”. If no rule makes a positive routing decision, the request is assigned to this pool.
A rule can also selectively enable or disable features in the Traffic Manager for that specific connection. For example, a rule can specify that the request should use a particular session persistence class, or that the response should not be cached.
Rules are constructed using Ivanti's TrafficScript language. This has the capability to inspect all aspects of the incoming request, from the source and destination port and IP to the type and actual content of the traffic. TrafficScript incorporates support for XPath (a language used to query XML documents), XSLT, and other XML-specific capabilities. These are often used by SOAP-based protocols employed by Web services, and enable complex data to be exchanged and understood automatically without user intervention.
Rules are applied in the order that you specify. You can apply rules to each incoming request, to each outgoing response, and at the completion of a transaction.
Create your rules in the rules catalog (see the Catalogs > Rules page of the Admin UI) and apply them through a virtual server. Any virtual server can use any rule from the catalog.
To add a rule to your virtual server, go to the applicable Virtual Servers > Edit page and click Rules. For request rules, use the "Request Rules" section. Likewise, for response and transaction completion rules, use the "Response Rules" and "Transaction Completion Rules" sections, respectively. Select a new rule to add from the drop-down box in the desired section, then click Add Rule.
The rules for your virtual server are shown in a list, and are applied in the order shown. Move a rule up or down the list using the grab handle to the left of each rule bar. Using the mouse pointer, drag and drop the rule to the new position you want it to be in; the Traffic Manager reorders the list automatically. If you have only one rule, no grab handle is displayed, and you cannot drag rules between sections.
You can disable a rule in the list to temporarily stop it from being executed, and re-enable it to make it active again.
For non-HTTP protocols that conduct a lengthy dialog with many requests and responses in one connection, you can choose whether a rule should be run “once” (just against the first request) or against “every” request.TrafficScriptTrafficScript Rules covers creating and applying rules in more detail.
The TrafficScript language is documented in a dedicated reference guide, available from the Ivanti Web site at: www.ivanti.com