Numeric Value Extraction

The Numeric Value Extraction Monitor is designed to extract a numeric value (number, duration or timestamp) from a text source, that is any output generated by a Monitor with Content (the output of a command, a Web page, the result of an SQL query, a file, WBEM query, etc.). You can, for example, extract a numeric value that will inform you about the queue length, processing time, utilization percentage, etc. of a specific technology.

To extract numeric values, you need to add the Numeric Value Extraction Monitor to a Monitor with Content and define the following properties:

  • the source from which you want to extract a value
  • the location of the numeric value within the searched lines using a regular expression
  • the position of the numeric value in the search lines. The position can be for example before or after a specific string, in a specific column, etc.
  • the value to be considered if several values are found (the first, the last, the highest, the lowest, etc.).
  • the expected format of the searched value in the source.

Click Dry Run to test the Monitor and CREATE to validate.

If the file to be parsed is a multi-line, XML, JSON, or HTML content, you may have to first pre-process its content.

Once the Numeric Value Extraction Monitor is properly configured, Monitoring Studio X will either:

  • search the numeric values in the new lines since the last polling. This is the operation mode for the log files and never-ending command lines.
  • or search in the entire source (the whole file, the whole standard output, the whole HTTP response, the whole data-set). This is the operation mode for flat files, command lines, Web requests, and database queries.

1. Define the Monitor

  1. Select a Value Type, that is the type of numeric value you wish to extract:

    • Number: any numeric value
    • Duration: a time duration string
    • Timestamp: a date/time string
  2. In the Extract Numeric Values From section, select the option corresponding to the lines that will be searched:

    • All Lines: (default): All lines of the text will be scanned for the numeric value search. There is no need to provide further information.

    • Line Numbers: Indicate the specific line numbers to be parsed .

    • Lines Matching Regular Expression: Only the lines matching the regular expression will be searched. Expected formats:

      • x, y: line x and line y
      • x-y: all lines from x to y inclusive
      • x: only line x
      • x-: all lines from x to the end of the file inclusive.
  3. Specify the position of the numeric value in the searched lines. Possible values are:

    • Anywhere in the Line: Select this option to retrieve the selected Value Type matching the specified Expected Format anywhere in the line (source). If more than one match is found, the Monitor will keep the first one.
    • After the String/Before the String: Enter the corresponding string.
    • At Character Offset: Enter the character number (Example: 7 to search for a numeric value that starts from the seventh character in the line).
    • In Column Number(s): Enter the number(s) of the column where the numeric value should be found (Example: 1 or 1-5 or 1,5) and, for each specified column:
      • select the Column Separator(s) that is used to distinguish column in the parsed source.
      • indicate how columns are to be displayed when multiple identical separators are found: Squash as one separator or Keep empty columns.
      • specify the type of Quotes to be expected in the parsed source, if any. If the search applies to several columns delimited by different delimiters, including a blank space, then columns will be delimited by a blank space. Otherwise, the first delimiter saved in the configuration will be used.
  4. Define the Expected Number Format, Expected Duration Format or Expected Timestamp Format of the value to extract.

    Value Type Supported Formats Default
    Number 100000.00, 100000,00, 100,000.00, 100 000.00,100,000,00, 100'000.00, 100'000,00 100000.00
    Duration %H for hours, %M for minutes, %S for seconds, and %d for days %H:%M:%S
    Timestamp %Y for 4-digit year, %y for 2-digit year, %m for month, %d for day, %H for hour, %M for minute, %S for second are commonly used identifiers.
    Refer to strftime(3) Linux Programmer's Manual for details about all supported formats.
    %Y/%m/%d %H:%M:%S
    Warning: The extraction for Duration will fail if the %H value is superior to 23, %M or %S values are superior to 59 or %d value is above 365.

    The expected format must match the format of the value in the source. Here are some examples of value types associated with their expected formats:

    Value Type Extracted Line Extract Numeric Values From Expected Format
    Duration Execution Time: T5:03:30.100 At Character Offset:17 T%H:%M:%S
    Duration Elapsed Time: 5 days 0 hours 3 minutes 15 seconds In Column Number:2- (delimiter: colon) %d days %H hours %M minutes %S seconds
    Duration backup completed in 0:0:30:10 with exit code: 0 After: completed in %d:%H:%M:%S
    Duration backup completed in 0:0:30:10 with exit code: 0 Before: with exit code %d:%H:%M:%S
    Timestamp 2020/03/31 23:50:00 WARN System failure In Column Number:1-2 %Y/%m/%d %H:%M:%S
    Timestamp 2007-04-05T14:30 In Column Number:1 %Y-%m-%dT%H:%M
    Timestamp backup started: 10/05/21 01:00 backup ended: 10/05/21 01:30 Before: backup ended: %d/%m/%y %H:%M
    Timestamp backup started: 10/05/21 01:00 backup ended: 10/05/21 01:30 After: backup ended: %d/%m/%y %H:%M
  5. Indicate if the Monitor should Skip Blank Lines. Default is YES. This option is only available when you have defined a specific line number to be parsed.

  6. Select the action you want Monitoring Studio X to perform When Several Lines Contain a Value:

    • Keep the Last value found (Default)
    • Calculate the Average of all the values found
    • Select the Lowest Value from all the values found
    • Select the Greatest Value from all the values found
    • Calculate the Sum of all the values found
  7. For Timestamp value type only: Set Value Parameter With the time format that you wish to use as a reference: Time Since Epoch (number of seconds since 01.01.1970 00:00:00 GMT), or Time Elapsed From Now (seconds elapsed till now).

  8. Indicate how you want the retrieved value to be exposed:

    • No Rescaling (Default): the value is exposed as retrieved in the extraction result.
    • Divide by: indicate the divisor to apply to the retrieved value.
    • Multiply by: indicate the factor to apply to the retrieved value.

2. Configure the Monitor Properties

  1. The Display Name is automatically built from the position of the numeric value in the searched lines and prefixed with the selected Value Type. For example, if you have specified that a value should be extracted from All Lines and At Character Offset: 1, the Display Name will read: Number: Offset 1.
  2. The Internal ID is automatically built from Template name, the parent Monitor and the Display Name. Click CHANGE to add a user-defined string that can help you better identify the Monitor (Optional).

3. Customize Options

Set the following options according your specific requirements:

  • Accept Negative Values: Turn this option ON (default) to discard negative values for the extraction result. By default, this option is turned OFF (Available for Number value type only).
  • Accept Scientific Notation: Turn ON to convert scientific notation to decimal format. For example: 1.5e3 is reported as 1500, 1.5e+3 as 1500, or 1.5e-1 as 0.15 (Available for Number value type only).
  • Automatic Units Conversion: Turn ON to convert units of collected value to their smallest units, i.e., Data units (kilobytes, megabytes, gigabytes, terabytes, etc.) will be converted to bytes; and time units (days, hours, minutes, etc.) to seconds to facilitate comparison between collected values (Available for Number value type only).
  • Discard Negative Delta Values: Turn ON to discard any negative value from the extraction result. Note that this option is only available when one of the DELTA parameters (see Parameters and Alerts section) is enabled.
  • Report Monitor Errors in Template's Collection Error Count: Turn ON if you wish to report any execution problem at the Template level. By default, this option is turned OFF.

4. Configure Parameters and Alerts

For each parameter, you can define up to three alarm ranges (Alarm #1, Alarm #2 and Out-of-range) each with a minimum and a maximum value:

  • Use the Alarm #1 and Alarm #2 options to define the range of parameter values that triggers warnings and alarms.
  • Use the Out-of-range border conditions to be informed when the collected values are outside the norm (less than or greater than the defined range limits).

Refer to the Configuring Alerts for details.

Parameters/Alerts Description
DELTA Difference between the current value and the previous value collected (no value reported when numeric value is not found). This value is set by the collector of the parent's object. Default is OFF.
DELTA PER HOUR Rate of change per hour in the expected value between current and previous collect (no value reported when numeric value is not found).
DELTA PER MINUTE Rate of change per minute in the expected value between current and previous collect (no value reported when numeric value is not found).
DELTA PER SECOND Rate of change per second in the expected value between current and previous collect (no value reported when numeric value is not found).
DELTA PERCENTAGE (%) Percentage of change between the current value and the previous value collected (no value reported when numeric value is not found).
PRESENT Whether the value is present or not ({0 = Missing ; 1 = Present}).
VALUE Value as extracted from the source.

Refer to Studio Number Extract for more information about the available parameters and the thresholds set by default.

No results.