Chapter 9 Advanced Expressions: String Sets, String Patterns, and Data Formats 163
2. Associate a pattern with the named pattern set, as follows:
bind policy patset pattern_name pattern
Where pattern_name is the name of a pattern that you want to configure
and pattern is an actual text pattern. Following is an example:
add policy patset myPatSet
bind policy patset myPatSet aaa
bind policy patset myPatSet bbb
bind policy patset myPatSet ccc
3. To view the named pattern set and its associated patterns, enter the
following command:
show policy patset pattern_name
Where pattern_name is the name of a pattern that you want to view.
4. Configure the pattern set as part of an expression in a policy.
For more information, see “Creating or Modifying an Advanced Policy,” on
page 14. Following is an example that uses the pattern set myPatSet, and
returns TRUE if the value of the HTTP header named myHeader contains
any of the strings that you defined earlier in this procedure:
add cache policy testPatSet -rule
http.req.header("myHeader").contains_any("myPatSet") -action
cache
To configure and use an index-based pattern set using the NetScaler
command line
1. At a NetScaler command prompt, type:
add policy patset patternName
Where pattern_name is the name of a pattern that you want to configure.
2. Associate a pattern and an index with the named pattern set, as follows:
bind policy patset patternName pattern -index number
Where patternName is the name of a pattern that you want to configure,
pattern is an actual text pattern, and number is the index value. Following is
an example:
add policy patset myPatSet1
bind policy patset myPatSet1 aaa -index 1
bind policy patset myPatSet1 bbb -index 5
bind policy patset myPatSet1 ccc -index 4
3. To view the named pattern set and its associated patterns, type: