RepeatingBlock Response Templates

Before reading on, please refer to the previous About Regions, Targets, and Markers section for general information on output blocks and targets.

A RepeatingBlock region contains a text portion that repeats several times within the command output. The repeating portion is similar to the free-form region in that it consists of lines and words.

A RepeatingBlock region can contain simple targets, Regex targets, or a combination of these.

To edit a RepeatingBlock-based response template:

  1. Click into the Response Template column, then click the Edit Response button next to the template that you want to edit.
  2. The Response Template Editor appears as shown in Figure:Response Template Editor Window, with the command's output displayed in the Command Response pane at the left.

  3. Select the repeating portion of the command output and click the Mark repeating block button.
  4. If the selection's end string is found to appear multiple times within the selection, a window appears enabling you to specify the RepeatingBlock region using the following options:

    • Accept updated block: Defines a RepeatingBlock region extending to the first occurrence of the end string.
    • Update end expression to match the original selection: Defines a RepeatingBlock region based on the initial selection.
    • Manually modify end expression: Defines a RepeatingBlock region extending to the string specified in the adjacent field.
    • Using this option could prove useful, for example, when selecting a RepeatingBlock region that has different end string for each of its occurrences. In such a case, you would then have to specify the \n end string, in order to select the entire line up to the end.

      A RepeatingBlock item is added to the Regions pane, with the Block region start and Block region end parameters containing regular expressions that reflect the regions boundaries. You can enter absolute values (both numeric and string) as well as variables as input, for these two parameters. To enter a variable, you need to precede it with a dollar sign ($).

  5. For adding a simple target, select a target within the defined repeating portion and click the Create target button, which adds a Target item to the Regions pane.
  6. In the Properties pane, edit the properties of the Target item as follows:

    • Target name: A target name reflecting the target type that is automatically assigned upon creation.
    • Target data type: The target data type, which can be String or Number.
    • Target description: An optional target description.
    • Type of target: For plain targets this parameter is set to the Text target value.
    • Name of column to get value from: For simple targets in RepeatingBlock-format templates, this information is N/A.
    • For simple targets within RepeatingBlock regions, the Regular expression template, Regular expression, Value of C1, and Repeating search fields are not available.

    • Value selected: The actual value of the selected target in all repeating blocks, which yields a list of values .
    • Export results: When this option is selected, the target value becomes available as a statistic via the step return variable.
    • Example:

      Considering the response of a ping command as illustrated by the image below:

      and assuming we were interested in retrieving the percentage of lost packets displayed in the command output.
      If we marked an entire line as a repeating block, and the response time within a line as a simple target, for the given example the target value displayed in the Value selected field would then be {129 130 130 131}.

  7. For adding a target that matches a user-defined regular expression, click the Create Regex target button, which adds a RegexSearch item to the Regions pane.
  8. In the Properties pane, specify in-place the properties of the Regex target as follows:

    • Target name: A target name reflecting the target type that is automatically assigned upon creation.
    • Target data type: The target data type, which can be String or Number.
    • Target description: An optional target description.
    • Type of target: This parameter is set to a Regex target value.
    • Name of column to get value from: For RepeatingBlock-based response templates, this information is N/A.
    • Regular expression template: A regular expression specifying a pattern to match. The regular expression template comprises a regular expression part, which corresponds to the target value that is actually retrieved, and a user-specified sub-string defined in the Value of C1 field.
    • For example, a [0-9]* C1 template contains a variable length digits sequence followed by a space and the C1 sub-string.

        The following regular expression templates are supported:
        [0-9]* C1 : Denotes all strings consisting of any number of digits, followed by a user-defined C1 string.
        [0-9]* =C1 : Denotes all strings consisting of any number of digits, terminated by the `=' character, and followed by a user-defined C1 string.
        [0-9]* %C1 : Denotes all strings consisting of any number of digits, terminated by the `%' character, and followed by a user-defined C1 string.
        [0-9]* ,C1 : Denotes all strings consisting of any number of digits, terminated by the `,' character, and followed by a user-defined C1 string.
        [0-9]* :C1 : Denotes all strings consisting of any number of digits, terminated by the `:' character, and followed by a user-defined C1 string.
        [0-9a-zA-Z]* C1 : Denotes all strings consisting of any number of digits, lower-case or upper-case characters, and followed by a user-defined C1 string.
        [0-9a-zA-Z]* =C1 : Denotes all strings consisting of any number of digits, lower-case or upper-case characters, terminated by the `=' character, and followed by a user-defined C1 string
        [0-9a-zA-Z]* %C1 : Denotes all strings consisting of any number of digits, lower-case or upper-case characters, terminated by the `%' character, and followed by a user-defined C1 string.
        [0-9a-zA-Z]* , C1 : Denotes all strings consisting of any number of digits, lower-case or upper-case characters, terminated by the `,' character, and followed by a user-defined C1 string.
        [0-9a-zA-Z]* :C1: Denotes all strings consisting of any number of digits, lower-case or upper-case characters, terminated by the `:' character, and followed by a user-defined C1 string.
        C1 [0-9]* : Denotes all strings preceded by a user-defined C1 string, and followed by a string consisting of any number of digits.
        C1 =[0-9]* : Denotes all strings preceded by a user-defined C1 string and the `=' character, and followed by a string consisting of any number of digits.
        C1 %[0-9]* : Denotes all strings preceded by a user-defined C1 string and the `%' character, and followed by a string consisting of any number of digits.
        C1 , [0-9]* : Denotes all strings preceded by a user-defined C1 string and the `,' character, and followed by a string consisting of any number of digits.
        C1 :[0-9]* : Denotes all strings preceded by a user-defined C1 string and the `:' character, and followed by a string consisting of any number of digits.
        C1 [0-9a-zA-Z]* : Denotes all strings preceded by a user-defined C1 string, and followed by a string consisting of any number of digits, lower-case or upper-case characters.
        C1 =[0-9a-zA-Z]* : Denotes all strings preceded by a user-defined C1 string and the `=' character, and followed by a string consisting of any number of digits, lower-case or upper-case characters.
        C1 %[0-9a-zA-Z]* : Denotes all strings preceded by a user-defined C1 string and the `%' character, and followed by a string consisting of any number of digits, lower-case or upper-case characters.
        C1 ,[0-9a-zA-Z]* : Denotes all strings preceded by a user-defined C1 string and the `,' character, and followed by a string consisting of any number of digits, lower-case or upper-case characters.
        C1 :[0-9a-zA-Z]* : Denotes all strings preceded by a user-defined C1 string and the `:' character, and consisting of any number of digits, lower-case or upper-case characters.

    • Regular expression: An editable regular expression corresponding to the selected regular expression template.
    • For example, for the sample [0-9]* C1 template considered above, the corresponding formula is (?<end>\d+)(?<md>[\s]+)(?<ft>C1).

      The formula comprises three sections, <end>, <m(id)d(le)>, and <f(irs)t>, which correspond to the [0-9]*, the space, and the C1 parts respectively.

      The regular expression language specification is documented at the Microsoft website located at the following location: http://msdn.microsoft.com/en-us/library/az24scfc.aspx.

    • Value of C1: A user-defined sub-string that is part of the previously defined regular expression template.
    • Value selected: The actual value of the selected target, which corresponds to the <end> portion of the regular expression. Since the target value is collected from all repeating blocks, this yields a `:'-separated list of values.
    • Repeating search: When this option is selected, the defined Regex target is searched repeatedly in the defined RepeatingBlock-format region. If more than one occurrence is found, the Value selected field displays a list of values for each region.
    • Export results: When this option is selected, the target value becomes available as a statistic via the step return variable.
  9. To add more than one target, repeat step 3 and/or 4.
  10. Alternatively, selecting a region or a target entry in the Regions pane and clicking the button removes it from the pane.

  11. Choose the File > Save or File > Save as command to save the Response Template into the resources database.
  12. More sample Response Template creation procedures are given in Appendix B, Response Templates Creation Samples.