Parse a URL

As part of creating or modifying a pattern, you can use the Parse URL operation to break down a URL to the component level.

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.

About this task

The URL parsing breaks a URL into the following components: protocol, hostname or IP, port, path and file.

Procedure

  1. On the Identification or Connectivity Sections form, select Parse URL from the Operation list.
  2. Fill in the fields, as appropriate.
    Field Description
    Source Specify the URL:
    • Enter a value that can change, a variable. Type the dollar character ($) and the first letters of the variable name. For example, $ldap_url.
    • Specify complex (concatenated) values in fields. Enter a value, then add a plus sign (+), and then enter another value. For example, $install_directory+"conf/httpd.conf".
    • Enter constant values, a string. For example, "/opt/ibm/mqsi/7.0/bin/".
    Important: Avoid entering a specific path to a location or file because it can be different on different operating systems. Use variables for paths.
    Target Specify the table to hold the results. Use variables, complex values or strings as described above.
  3. Select Terminate to stop the discovery process if no results are found.
  4. If in Debug mode, test the step by clicking Test and checking that the operation brings the result you expected.

Example

This operation is used in This item
Hierarchy Applications > Application Servers
CI Type Apache Web Server [cmdb_ci_apache_web_server]
Pattern Apache On Unix Pattern
Section Create LDAP connections
Step number and Name 3. parse ldap url

To break an LDAP directory URL to components and save the results in a new table, use the Parse URL operation as follows:


Defining the Parse URL operation

What to do next