String groups are simply lists of strings, such as URLs or client names which may be used by various functionality throughout Avi Vantage. String groups come in two flavors, either a basic list, or when String Map is selected, a list of key/value pairs.
A string group may be used for custom purposes such as lists of allowed clients. Avi Vantage includes several pre-created string groups which may be used by various functionality described below. By leveraging a string group, lengthy lists can be reused throughout the system. For DataScripts or policies, it enables Avi Vantage to maintain the rule logic separately from the list of strings. This makes administration easier, since an administrator can update the list without being exposed to the underlying logic or script that uses the strings.
String groups may be automatically updated via external API calls. When a group is updated, the update is pushed from the Controller to any Service Engines that are hosting virtual services that are leveraging the string group.
The following are a few examples of string groups used within Avi Vantage.
- Compression: Avi Vantage includes a default System-Compressible-Content-Types string group. This is a list of MIME types that determine if an HTTP response is eligible to be compressed.
- Caching: Avi Vantage includes a default System-Cacheable-Resource-Types string group. This is a list of MIME types that determine if an HTTP response is eligible to be cached. See HTTP Caching for other parameters that may factor into the eligibility of an object being cached.
- Policies: HTTP security and HTTP request policies may be triggered based on criteria matched against a string group. For example, if a browser’s User-Agent header matches an entry in a string group, send the request to a specific pool.
- Logs Logs may be selectively enabled based on a match in a VS > Analytics > log filter. The filter can compare a client’s requested path against a string group containing the list of important paths or URLs.
- DataScript: Custom decisions may be made based on a match against an entry in a string group. See the DataScript function avi.stringgroup.contains for examples and syntax.
The table on the Templates > Groups > String Group page contains the following information for each string group:
- Name: Name of the string group.
- Type: Either string, which is a list of strings, or map, which is a list of key value pairs.
- Number of Strings: Number of strings within a string group.
Create a String Group
From the Avi UI, navigate to Templates > Groups > String Groups.
In the Create String Group screen, enter the Name of the String Group.
Select String as the Type.
To Import String(s) From File click Import File and select a comma-separated-value (CSV) file that contains text.
Click Add to enter the strings.