String groups are simply lists of strings, such as URLs or client names which may be used by various functionality throughout NSX Advanced Load Balancer. It comes in two flavors, either a basic list or, when a 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. NSX Advanced Load Balancer 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 NSX Advanced Load Balancer 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 using 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.
Usage
The following are a few examples of string groups used within NSX Advanced Load Balancer.
-
Compression: NSX Advanced Load Balancer 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: NSX Advanced Load Balancer 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 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
. 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 in VMware NSX Advanced Load Balancer DataScript Guide for examples and syntax.
The table on the
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 NSX Advanced Load Balancer UI, navigate to .
-
Click Create.
-
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.
-
Click Save.