Citrix ADC

Configuring a Pattern Set

To configure a pattern set, you must specify the strings that are to serve as patterns. You can manually assign a unique index value to each of these patterns, or you can allow the index values to be assigned automatically.

Note: Pattern sets are case sensitive (unless you specify the expression to ignore case). Therefore, the string pattern “product1,” for example, is not the same as the string pattern “Product1.”

Points to remember about index values:

  • You cannot bind the same index value to more than one pattern.
  • An automatically assigned index value is one number larger than the highest index value of the existing patterns within the pattern set. For example, if the highest index value of existing patterns in a pattern set is 104, the next automatically assigned index value is 105.
  • If you do not specify an index for the first pattern, index value 1 is automatically assigned to that pattern.
  • Index values are not regenerated automatically if one or more patterns are deleted or modified. For example, if the set contains five patterns, with indexes from 1 through 5, and if the pattern with an index of 3 is deleted, the other index values in the pattern set are not automatically regenerated to produce values from 1 through 4.
  • The maximum index value that can be assigned to a pattern is 4294967290. If that value is already assigned to a pattern in the set, you must manually assign index values to any newly added patterns. An unused index value that is lower than a currently used value cannot be assigned automatically.

To configure a pattern set by using the command line interface

At the command prompt, do the following:

  1. Create a pattern set.

    add policy patset

Example:

add policy patset samplepatset

  1. Bind patterns to the pattern set.

    bind policy patset [-index ][-charset ( ASCII | UTF_8 )] [-comment ]

Example:

bind policy patset samplepatset product1 -index 1 -comment short description about the pattern bound to the pattern set

Note: Repeat this step for all the patterns you want to bind to the pattern set.

  1. Verify the configuration.

show policy patset

To configure a pattern set by using the configuration utility

  1. Navigate toAppExpert>Pattern Sets.
  2. In the details pane, clickAddto open theCreate Pattern Setdialog box.
  3. Specify a name for the pattern set in the Name text box.
  4. Under Specify Pattern, type the first pattern and, optionally, specify values for the following parameters:
    • 将反斜杠作为逃避人物选择check box to specify that any backslash characters that you might include in the pattern are to be treated as escape characters.
    • Index—A user assigned index value, from 1 through 4294967290.
  5. Verify that you have entered the correct characters, and then clickAdd.
  6. 重复步骤4和5添加更多的模式,和n clickCreate.

Configure file-based pattern sets

The Citrix ADC appliance supports file-based pattern sets.

To configure file-based pattern sets by using CLI

At the command prompt, type the following commands:

  • Import a new pattern set file into the Citrix ADC appliance.

    import policy patsetfile   -delimiter  -charset  

    Example:

    import policy patsetfile local:test.csv clientids_list –delimiter , 

    You can import a file from a local device, HTTP server, or FTP server. To add the file from your local device, the file must be available in/var/tmplocation.

  • Update an existing pattern set file on the Citrix ADC appliance.

    update policy -patsetfile  

    Example:

    update policy -patsetfile clientids_list 
  • Add a pattern set file to the packet engine.

    add policy -patsetfile  

    Example:

    add policy -patsetfile clientids_list 
  • Bind patterns to the pattern set.

    add policy patset  -patsetfile  

    Example:

    add policy patset clientid_patset -patsetfile clientids_list 
  • Verify the configuration.

    show policy patsetfile clientids_list Name: clientids_list Patset Name: clientid_patset Number of Imported Patterns: 8 Number of Bound Patterns: 8 (All the patterns bound successfully) Done 

To configure file-based pattern sets by using GUI

  1. Navigate toAppExpert-> Pattern Set Files.

  2. In theImportedpane, clickImport.

  3. In theConfigure Policy Patset Filepage, select the file you want to import, and clickOK.

  4. Select the imported file, and clickAdd.

  5. In theCreate Policy Patset Filepage, enter the details, and clickCreateto add a policy pattern set.

Configuring a Pattern Set