Read more about Data Workbench’s End-of-life announcement.
Information about test operation conditions including compare, not empty, range, regular expression, and string match.
The Compare condition compares string or numeric values. For comparisons of string values, you can specify whether case should be considered.
The parameters of the Compare condition are described in the following table:
Parameter | Description | Default |
---|---|---|
Case Sensitive | True or false. Used only if the Type is LEXICAL. If set to false, upper and lower case letters are considered equal. | true |
Comments | Optional. Notes about the condition. | Comments |
Input A | The first of the two values to compare. This value represents the left operand in the condition. | |
Input B | The second of the two values to compare. This value represents the right operand in the condition. | |
Operation | The comparison operation. The available operations (and their meanings) are as follows:
|
= |
Type | The type of comparison to be made. Available types are LEXICAL, NUMERIC, and DATETIME. For descriptions of the types, see Test Types for Test Operations. | LEXICAL |
This example uses a Compare condition to define the Log Entry Condition. As the data workbench server reads each event data record, it compares the numeric values x-age and 55. If for a given log entry, x-age is less than or equal to 55, the log entry is included in the dataset construction process.
The Not Empty condition checks a field to see if it contains a value or is empty. The condition is satisfied for any log entry whose value for the Input field is not empty.
The parameters of the Not Empty condition are described in the following table:
Parameter | Description | Default |
---|---|---|
Comments | Optional. Notes about the condition. | Comments |
Input | The name of the field from the log entry to check for content. |
This example takes as its input x-some-field and tests whether the field is not empty. The condition is satisfied if the field is populated.
The Range condition takes an input field and determines whether the value of that field falls, inclusively, within the given minimum (Min) and maximum (Max) parameter values.
The parameters of the Range condition are described in the following table:
Parameter | Description | Default |
---|---|---|
Case Sensitive | True or false. Used only if the Type is LEXICAL. If set to false, upper and lower case letters are considered equal. | true |
Comments | Optional. Notes about the condition. | Comments |
Input | The name of the field from the log entry to use as input. | |
Min | Lower bound of range. This parameter's value must be a literal value or a string - not a field name. If you use a date for this field, you must specify a time zone. For a list of supported time zone abbreviations, see Time Zone Codes. |
|
Max | Upper bound of range.
Note: This parameter's value must be a literal value or a string - not a field name. If you use a date for this field, you must specify a time zone. For a list of supported time zone abbreviations, see Time Zone Codes. |
|
Type | The type of comparison to be made. Available types are LEXICAL, NUMERIC, and DATETIME. For descriptions of the types, see Test Types for Test Operations. |
This example uses a Range condition to define the Log Entry Condition. As the data workbench server reads each event data record, it compares the numeric values x-age and 55. If for a given log entry, x-age is at least 55, the log entry is included in the dataset construction process. This example performs the same function as the Compare condition example. See Compare.
If the Min or Max parameter is left blank, the data workbench server substitutes the minimum or maximum integer values available. The minimum value is zero (0), and the maximum value is infinity.
The Regular Expression condition test uses regular expressions pattern matching (see Regular Expressions) to determine whether the value of the specified input field contains a string that matches one of the patterns specified in the Matches parameter.
If the input is a vector of strings, only the first value in the vector is used for the test. The Regular Expression condition performs full string comparisons. If you want to identify substrings, you must prepend and append “.*” to the string.
The parameters of the Regular Expression condition are described in the following table:
Parameter | Description | Default |
---|---|---|
Case Sensitive | True or false. If set to false, upper and lower case letters are considered equal. | true |
Comments | Optional. Notes about the condition. | Comments |
Input | The name of the field from the log entry to use as input. | |
Matches | The regular expression pattern(s) to match against the value of the input field. To add a regular expression pattern
|
This example illustrates the use of the Regular Expression condition to match a field of data collected from website traffic. The condition returns true only if the cs(referrer-query) field contains a string matching the regular expression campaign=C[1-9][0-9]{4}
. This regular expression matches any string containing campaign=C12345
. However, the pattern would not match the string campaign=C0123&
because the first character after the C
is not in the range 1-9
.
The String Match condition tests for string equality. It takes a specified field as input and tests the value of that field in each log entry against the strings specified in the operation’s Matches parameter. If any one of these case-sensitive match strings is the same as the value in the provided input field, the operation returns true. In the event that the StringCondition contains no match strings, the condition returns false. If the input is a vector of strings, only the first value (string) in the vector is used for the test.
Parameter | Description | Default |
---|---|---|
Case Sensitive | True or false. If set to false, upper and lower case letters are considered equal. | true |
Comments | Optional. Notes about the condition. | Comments |
Input | The name of the field from the log entry to use as input. | |
Matches | The string(s) to match against the value of the input field. To add a string
|
This example uses data collected from website traffic to illustrate the use of the String Match condition. The condition tests whether the input field (cs-uri-stem) matches either of the two strings specified in the Matches parameter, and it succeeds if the field cs-uri-stem is either the exact string /navigation/footer.asp or the exact string /navigation/header.asp.