64

Citrix NetScaler Policy Configuration and Reference Guide

About Text Expressions

You can configure various expressions for working with text that flows through the NetScaler. Following are some examples of how you can parse text using an advanced expression:

Determine that a particular HTTP header exists.

For example, you may want to identify HTTP requests that contains a particular Accept-Language header for the purpose of directing the request to a particular server.

Determine that a particular HTTP URL contains a particular string.

For example, you may want to block requests for particular URLs. Note that the string can occur at the beginning, middle, or end of another string.

Identify a POST request that is directed to a particular application.

For example, you may want to identify all POST requests that are directed to a database application for the purpose of refreshing cached application data.

Note that there are specialized tools for viewing the data stream for HTTP requests and responses. For example, you can download a Firefox Web browser plug-in that displays HTTP request and response headers from the following URL:

https://addons.mozilla.org/en-US/firefox/addon/3829

The following plug-in displays headers, query strings, POST data, and other information:

https://addons.mozilla.org/en-US/firefox/addon/6647

After downloading these plug-ins, they are accessible from the Firefox Tools menu.

About Operations on Text

A text-based expression consists of at least one prefix to identify an element of data and usually (although not always) an operation on that prefix. Text-based operations can apply to any part of a request or a response. Basic operations on text include various types of string matches.

For example, the following expression compares a header value with a string:

http.req.header("myHeader").contains("some-text")

Following expressions are examples of matching a file type in a request:

http.req.url.suffix.contains("jpeg")

http.req.url.suffix.eq("jpeg")

Page 78
Image 78
Citrix Systems 9.2 manual About Text Expressions, About Operations on Text