Beruflich Dokumente
Kultur Dokumente
Contents
String Maps
You can use string maps to perform pattern matching in all NetScaler features that use the
default policy syntax. A string map is a NetScaler entity that consists of key-value pairs.
The keys and values are strings in either ASCII or UTF-8 format. String comparison uses two
new functions, MAP_STRING(<string_map_name>) and
IS_STRINGMAP_KEY(<string_map_name>).
A policy configuration that uses string maps performs better than one that does string
matching through policy expressions, and you need fewer policies to perform string
matching with a large number of key-value pairs. String maps are also intuitive, simple to
configure, and result in a smaller configuration.
Value
/url_1.html
http://www.redirect_url_1.com/url_1.html
/url_2.html
http://www.redirect_url_2.com/url_2.html
/url_3.html
http://www.redirect_url_1.com/url_1.html
The following table describes the two functions that have been introduced to enable string
matching with keys in a string map. String matching is always performed with the keys.
Additionally, the following functions perform a comparison between the keys in the string
map and the complete string that is returned by the expression prefix. The examples in the
descriptions refer to the preceding example.
Table 2. String Map Functions
nction
Description
EXT>.MAP_STRING(<string_map_name>)
Checks whether the value returned by the expression prefix TEXT matches an
in the string map, and returns the value that corresponds to the key. If no key
map matches the value returned by the expression prefix, the function return
string. The IGNORECASE and NOIGNORECASE functions can be used for case
and case-sensitive comparison, respectively.
HTTP.REQ.URL.SET_TEXT_MODE(IGNORECASE).MAP_STRING("url_stri
checks whether the string returned by HTTP.REQ.URL is a key in the string m
url_string_map. The comparison does not consider case. If the string returned
HTTP.REQ.URL is /URL_1.html, the function returns
http://www.redirect_url_1.com/url_1.html.
Parameters:
string_map_name - The string map.
EXT>.IS_STRINGMAP_KEY(<string_map_name>)
Returns TRUE if the string returned by the expression prefix TEXT is a key in
map. The IGNORECASE and NOIGNORECASE functions can be used for case-i
and case-sensitive string matching, respectively.
Example 1:
HTTP.REQ.URL.IS_STRINGMAP_KEY("url_string_map") returns TRUE
HTTP.REQ.URL is one of the keys in url_string_map.
Example 2: HTTP.REQ.URL.SET_TEXT_MODE(IGNORECASE).
IS_STRINGMAP_KEY("url_string_map") returns TRUE if the value of HT
is one of the keys in url_string_map. In this case, key lookup does not conside
Therefore, the function returns TRUE even if the value of HTTP.REQ.URL is
/URL_3.html.
Parameters:
string_map_name - The string map.