Parsing the entire URL string allows you to select a portion of a URL to perform hashing on. The URL is searched to find a pattern string. This pattern string is combined with a configured offset value to identify a starting point. From this starting point in the URL, a string that will be used for hashing is derived by a method that is specified by the options you select for the hash-persist url search-url command. These options are described in the following.
Parsing using the “pattern string” only – With this option, the ServerIron ADX begins at the starting point in the URL and includes all of the characters up-to the end of the URL to form the string used for hashing.
Search URL string by starting at a “pattern string” and ending at a delimiter – With this option, the ServerIron ADX begins at the starting point in the URL and includes all of the characters up-to a specified delimiter character in the URL to form the string used for hashing.
Search URL string by starting at a “pattern string” and continuing for a specified length – With this option, the ServerIron ADX begins at the starting point in the URL and includes the number of characters specified to form the string used for hashing.
Parsing using the “pattern string” only
The following example identifies a pattern string to perform hashing on with an offset of “0”.
TABLE 6 Hashing methods
Method String used for hashing
Complete login.brocade.com/confg/mail?.src=ym
path-only config/mail
path-and-parameters confg/mail?.src=ym
host-only login.brocade.com
Cache persistence using URL hashing
2
NOTE
Because hash-persist action is a secondary action, you must add a forward action as shown in the following example, before adding a hash-persist action.
ServerIronADX(config)#csw-policy p1
ServerIronADX(config-csw-p1)#match r1 forward 1
ServerIronADX(config-csw-p1)#match r1 hash-persist url search-url “v=” offset 0
Syntax: [no] hash-persist url search-url <pattern-string> offset <offset-value>
The contents of the <pattern-string> variable are used to define the starting place on the URL string. If the URL string has multiple such pattern strings, only the first one will be used. If the pattern string is not found, the system will abort the rest of the searching steps, and choose the default hashing method. If the pattern string is found, the system will start the second step after skipping the length of the pattern string. The second step in the process is to adjust the starting place on the URL string by moving it by the number of characters defined by a value specified in the
<offset-value>. If the pattern string is empty, the system will not search the pattern part, and use
the beginning of URL string as the start point of the third step.
The <offset-value> is used to define how many characters will be skipped after the start point that is defined by the pattern-string. Normally this value is 0 (zero) which places the start point directly after the pattern string. A negative value can be used to move the starting place to the left in the URL string. If the <offset-value> is greater than the length of the rest of the URL string, the system will abort the rest of the searching steps, and start the next search (if configured). If another search isn’t configured, the default hashing method is used. If the value of the <offset-value> variable is within the length of the rest of the URL string, the system will skip to the offset place, and start the third step.
With this command, the third step is for the system to look to the end of the URL to define the string used for hashing.
Parsing using the “pattern string” with a delimiter
The following example identifies a pattern string to perform hashing on with an offset of “0” and a delimiter with the value “&”.
NOTE
Because hash-persist action is a secondary action, you must add a forward action as shown in the following example, before adding a hash-persist action.
ServerIronADX(config)#csw-policy p1
ServerIronADX(config-csw-p1)#match r1 forward 1
ServerIronADX(config-csw-p1)#match r1 hash-persist url search-url “v=” offset 0 delimiter “&”
Syntax: [no] hash-persist url search-url <pattern-string> offset <offset-value> delimiter <delimiter-string>
The contents and operation of the <pattern-string> variable is the same as described in “Parsing
using the “pattern string” only”.
The contents and operation of the <offset-value> is the same as described in “Parsing using the
Cache persistence using URL hashing
2
With this command, the third step is for the system to parse the URL string up-to a character defined by the value of the <delimiter-string>. The delimiter string is used to define the end pattern after finding the substring. If the rest of URL string has multiple delimiter strings, only the first one will be used. If the <delimiter-string> is not found, or the value of the <delimiter-string> value is empty, the system will look to the end of the URL to define the string used for hashing.
Parsing using the “pattern string” with a specified string length
The following example identifies a pattern string to perform hashing on with an offset of “0” and a length value of “8”.
NOTE
Because hash-persist action is a secondary action, you must add a forward action as shown in the following example, before adding a hash-persist action.
ServerIronADX(config)#csw-policy p1
ServerIronADX(config-csw-p1)#match r1 forward 1
ServerIronADX(config-csw-p1)#match r1 hash-persist url search-url “v=” offset 0 length 8
Syntax: [no] hash-persist url search-url <pattern-string> offset <offset-value> length <length>
The contents and operation of the <pattern-string> variable is the same as described in “Parsing
using the “pattern string” only”.
The contents and operation of the <offset-value> variable is the same as described in “Parsing
using the “pattern string” only”.
With this command, the third step is for the system to parse the URL string up-to the number of characters defined by the value of the <length> variable. The value of the <length> variable must be greater than 0 (zero). If the value of the <length> variable extends beyond the length of the URL, the system will look to the end of the URL to define the string used for hashing.
Examples for parsing on the entire URL
In the following example, the client tries to connect to youtube at the following URL.
http://www.example4.com/watch?v=bUfp24dwzOA&playnext=1&videos=XA7MyzKoQXQ&feature =featured
Table 7 displays the contents of the strings used for hashing if the <pattern-string> variable is set to “v=” and the offset value is set to “0” depending on the method used. The methods and commands required are described as follows.
Parsing using the “pattern string” only
ServerIronADX(config)#csw-policy p1
ServerIronADX(config-csw-p1)#match r1 forward 1
ServerIronADX(config-csw-p1)#match r1 hash-persist url search-url “v=” offset 0
Parsing using the “pattern string” with a delimiter
ServerIronADX(config)#csw-policy p1
ServerIronADX(config-csw-p1)#match r1 forward 1
ServerIronADX(config-csw-p1)#match r1 hash-persist url search-url “v=” offset 0 delimiter “v=”
Parsing using the “pattern string” with a specified string length
Cache persistence using URL hashing
2
ServerIronADX(config-csw-p1)#match r1 forward 1
ServerIronADX(config-csw-p1)#match r1 hash-persist url search-url “v=” offset 0 length 16