Parse a variable

As part of creating or modifying a pattern, you can use the Parse variable operation to extract information from a variable and to store it in a variable table.

Before you begin

Navigate to the relevant pattern step:

  1. On the pattern form:
    • Select the relevant identification section for Discovery.

      Or

    • Select the relevant identification or connection section for Service Mapping.
  2. Select the relevant pattern step or click to add a step.

Role required: pd_admin

Basic knowledge of programming is desirable.

Procedure

  1. Select Parse variable from the Operation list.
  2. Define the variable that you wish to parse in the Enter Variable field.
  3. Select the relevant parsing strategy from the Define Parsing list and define the parsing criteria.
    Parsing strategy Description

    Oracle

    LDAP file

    XML file

    INI file

    Properties file

    JSON file (custom)

    Horizontal file parsing strategy (not vertical). You can use this parsing strategy only for text files. For more information, see Parse text from a horizontal file.
    Vertical File Retrieve text from a structured text file where each set of data spans multiple lines. For more information, see Parse text from a vertical file.

    After Keyword

    Retrieve text directly following a specific keyword. For more information, see Parse text using keyword, command, and positional type.

    Command Line Java Style

    Retrieve the value of a command-line parameter using Java-style parameters. For more information, see Parse text using keyword, command, and positional type.

    Command Line Unix Style

    Retrieve the value of a command-line parameter using standard Unix parameters. For more information, see Parse text using keyword, command, and positional type.

    Position From End

    Retrieve text specified by its position from the end of the line. For more information, see Parse text using keyword, command, and positional type.

    Position From Start

    Retrieve text specified by its position from the beginning of the line. For more information, see Parse text using keyword, command, and positional type.

    Regular Expression Retrieve text specified by a regular expression. This option requires familiarity with Regex Java syntax. For more information, see Parse text using a regular expression.
    Delimited Text Retrieve text specified by delimiters and position within the line (the most common way to retrieve text from generic text files). See Parse text using delimited text.
  4. Select Terminate to stop the discovery process if no results are found.
  5. If in Debug mode, test the step by clicking Test and checking that the operation brings the result you expected.

Example

You can use the Command Line Java Style parsing strategy to extract the path of the installation directory of the WebSphere Server.


Using the Command Line Java Style parsing strategy

What to do next