#
Generic Log Parser
#
Introduction
The Open iT Generic Log Parser is designed to parse collected license usage data stored in CSV-formatted log files with a header line. It efficiently converts these logs into the Open iT standard format, provided the data matches a configured match object.
LogParserGeneric can process various event formats, making it flexible for different types of license server outputs.
#
Supported Log Formats
LogParserGeneric can handle logs that record check-in and check-out events in various formats, whether on separate lines or combined into a single line.
#
Normal Format
This format refers to a log where check-in and check-out events are recorded as separate lines in the CSV file. Each line represents a single event, either a check-out or a check-in.
Date,Event,Computer,User,Product,Type,Total,Used
2019-08-05 17:48:57,License loaned out,Computer_01,User_01,Product_A,Commercial,Release,5,1
2019-08-05 18:36:46,License returned,Computer_01,User_01,Product_A,Commercial,Release,5,0
In this example:
In the first row, at the time
2019-08-05 17:48:57
, the event recorded is License loaned out, indicating that the userUser_01
borrowed a license for the productProduct_A
. At this moment, the number of used licenses increased, as shown by theUsed = 1
field.In the second row, at
2019-08-05 18:36:46
, the event recorded is License returned, meaning that the same user,User_01
, returned the license forProduct_A
. As a result, the number of used licenses decreased, reflected byUsed = 0
.
#
Single-Line Format
This format refers to a log where both the check-out and check-in events are recorded within the same line of the CSV log file.
Module,User@Computer,Start Time,Exit Time,Duration Time [D-H:M:S],Duration Time [min],Use Mode
Moldex3D-GENERIC SOLUTION-17,User_01@014-0733,2020/04/01-14:44:36,2020/04/01-15:36:40,0-0:52:03,52.07,1
Moldex3D-MFE SOLVER-17,User_01@014-0733,2020/04/01-14:44:36,2020/04/01-15:36:40,0-0:52:03,52.07,1
In this example:
In the first row,
User_01
on computer014-0733
started using theMoldex3D-GENERIC SOLUTION-17
module at2020/04/01-14:44:36
and ended the session at2020/04/01-15:36:40
. The total usage duration was approximately 52 minutes, and the usage mode is indicated by the value1
.Similarly, the second row represents another session for
Moldex3D-MFE SOLVER-17
with identical start and end times.
In this format, there is no event type field explicitly recorded. To properly distinguish the check-in and check-out, include both the start-end-event_type
and required-fields
code blocks in the match object configuration file.
Go to Configuration directory, which is by default in
C:\Program Files\OpeniT\Core\Configuration
. In this directory, locate and open the matchobject configuration file (.oconf
) that corresponds to your License Manager. For example, if you are configuring the Moldex3D License Manager, open the file namedmatchobjects-event-moldex3d.oconf
.Add a
start-end-event_type
code block undermatchobjects
section.start-end-event type Configuration Syntaxstart-end-event_type { description=This object defines event types. match1 { start-event_type { type=string value=<start_time> } end-event_type { type=string value=<exit_time> } } }
where:
Parameters for Configuring Match Objects
Example:
Suppose the CSV log file contains columns named Start Time and Exit Time. The configuration should look like this:
Example: matchobjects-event-moldex3d.oconfroot { matchobjects { start-end-event_type { description=This object defines event types. match1 { start-event_type { type=string value=Start Time } end-event_type { type=string value=Exit Time } } } ... } ... }
In this example, the
Start Time
is assigned tostart-event_type
, representing when the license session began (check-out) andExit Time
is assigned toend-event_type
, representing when the license session ended (check-in).Then, add a
required-fields
code block undermatchobjects
section.required-fields Configuration Syntaxrequired-fields { type=string value=time|duration start-time { type=string value=<start_time> } end-time { type=string value=<exit_time> } }
where:
required-fields Parameters for Configuring Match Objects
Example:
Suppose the CSV log file contains columns named Start Time and Exit Time. The configuration should look like this:
Example: matchobjects-event-moldex3d.oconfroot { matchobjects { required-fields { type=string value=time|duration start-time { type=string value=Start Time } end-time { type=string value=Exit Time } } ... } ... }
In this example, the
Start Time
is assigned tostart-time
, representing when the license session began (check-out), and theExit Time
is assigned toend-time
, representing when the license session ended (check-in).Save the
.oconf
file to apply your changes.
#
Separated Line Format with Check-In and Check-Out Time Columns
This format refers to a log where check-in and check-out events are recorded on separate lines, but each line includes both time fields (check-in and check-out time columns). The event type is inferred based on which of the two time fields is populated:
- If only the check-in time is present and the check-out time is empty, the line represents a check-in event.
- If only the check-out time is present and the check-in time is empty, the line represents a check-out event.
License Code,User Name,Machine Name,Lease End,Activated,Status,Deactivated,Computer ID,VM,VM Lease End
License_123ABC,User_jdoe,DesktopWin_123,2023-01-05 13:07:47,2023-01-05 13:07:47,ACTIVATED,,ComputerID_01,HyperV,8
License_123ABC,User_jdoe,DesktopWin_123,2023-01-05 21:07:47,,DEACTIVATED,2023-01-05 15:41:12,ComputerID_01,HyperV,8
In this example:
The first row shows that the
Activated
field—which serves as the check-out time—is populated with a timestamp2023-01-05 13:07:47
, while theDeactivated
field (the check-in time) is empty. This indicates a check-out event, meaning the license was activated at that time and is still active.The second row shows that the
Activated
field is empty, but theDeactivated
field contains a timestamp2023-01-05 15:41:12
. This represents a check-in event, meaning the license was deactivated or returned at that specific time.
To support this format, add the required-fields
code block to the match object configuration file to define which fields represent the check-out and check-in times.
Go to Configuration directory, which is by default in
C:\Program Files\OpeniT\Core\Configuration
. In this directory, locate and open the matchobject configuration file (.oconf
) that corresponds to your License Manager. For example, if you are configuring the Zoo License Manager, open the file namedmatchobjects-event-zoo.oconf
.Add a
required-fields
code block undermatchobjects
section.required-fields Configuration Syntaxrequired-fields { type=string value=time|duration checkout_time { type=string value=Activated } checkin_time { type=string value=Deactivated } }
where:
Parameters for Configuring Match Objects
Example:
Suppose the CSV log file contains columns named Activated and Deactivated. The configuration should look like this:
Example: matchobjects-event-lm.oconfroot { matchobjects { required-fields { type=string value=time|duration checkout_time { type=string value=Activated } checkin_time { type=string value=Deactivated } } ... } ... }
In this example, the
Activated
field is mapped tocheckout_time
, indicating the timestamp when the license was activated (check-out), while theDeactivated
field is mapped tocheckin_time
, representing when the license was deactivated (check-in).
#
Skip Line Support
Generic Log Parser can skip unnecessary or irrelevant lines by adding the skip-line
code block in the match object configuration file.
To configure skip-line
:
Go to Configuration directory, which is by default in
C:\Program Files\OpeniT\Core\Configuration
. In this directory, locate and open the matchobject configuration file (.oconf
) that corresponds to your License Manager. For example, if you are configuring the Moldex3D License Manager, open the file namedmatchobjects-event-moldex3d.oconf
.Add a
skip-line
child node undermatchobjects
section.skip-line Configuration Syntaxskip-line { description=These are used to identify lines that need to be skipped. match1 { match-regex { type=string value=<regex_pattern_to_skip> } } // Additional matches can be added as match2, match3, etc. }
where:
Parameters for Configuring Match Objects
Each
match-regex
defines a regular expression pattern that identifies a line to be skipped. If a line matches any of the configured patterns, it will be excluded from further parsing.Example:
Suppose the log file contains lines such as
Moldex3DUsageLog - Start
orCreate time: 2024-04-01 12:00:00
that are irrelevant for parsing. You can configure the match object to skip these lines by adding askip-line
block as shown below:Example: matchobjects-event-moldex3d.oconfroot { matchobjects { skip-line { description=Skip Moldex3D Usage Log and Create time match1 { match-regex { type=string value=File=Moldex3DUsageLog.* } } match2 { match-regex { type=string value=Create time.* } } } ... } ... }
In this example:
- The first
match-regex
skips any line that begins withFile=Moldex3DUsageLog
, such asFile=Moldex3DUsageLog_20200401.csv,,,,,,
. - The second
match-regex
skips any line that begins withCreate time
, such asCreate time=2020/04/01-00:00:20,,,,,,
.
These lines will be ignored during parsing and excluded from the final output, ensuring only relevant license usage entries are processed.
- The first