$ptime (parse-spec) function
Return the time in milliseconds associated with an ISO formatted Period time value selected by the parse specification argument. The ISO formatted time is in the standard format of PHHH:MM:SS.mmm. This parse function is mainly useful for parsing out performance counter values that occur in certain BMC Defender agent messages, where this time representation is extensively used. The value can have any number of leading hours or training milliseconds, but the minutes and second values should range from 00 to 59. If the parsed value is not an ISO time value, no time value is returned.
Target string | Parse expression | Return value |
|---|---|---|
CPU: P0:00:00.25
| $ptime(CPU: *) | 250 The ISO time value represents 250 milliseconds elapsed time. |
Time: P1:00:00.0 | $ptime(Time: *) | 3600000 The ISO time value represents one hour in milliseconds. |
Time: P1:00:00:00 | $scale( $ptime (time: *), .001, 0) | 3600 The $scale() function is applied to divide the time by 1000, to represent elapsed seconds. For more information, see scale-parse-spec-fmultiplier-foffset-function. |
Value: P100:00 | $ptime(value: *) | No match. The parsed value is not in ISO format. |
Related topic