# 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.

Example: CSV Log File Content
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 user User_01 borrowed a license for the product Product_A. At this moment, the number of used licenses increased, as shown by the Used = 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 for Product_A. As a result, the number of used licenses decreased, reflected by Used = 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.

Example: CSV Log File Content
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 computer 014-0733 started using the Moldex3D-GENERIC SOLUTION-17 module at 2020/04/01-14:44:36 and ended the session at 2020/04/01-15:36:40. The total usage duration was approximately 52 minutes, and the usage mode is indicated by the value 1.

  • 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.

  1. 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 named matchobjects-event-moldex3d.oconf.

  2. Add a start-end-event_type code block under matchobjects section.

    start-end-event type Configuration Syntax
    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>
            }
        }
    }

    where:

    Parameter Description
    <start_time> Refers to the check-out time field in the CSV header.
    <exit_time> Refers to the check-in time field in the CSV header.
    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.oconf
    root
    {
        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 to start-event_type, representing when the license session began (check-out) and Exit Time is assigned to end-event_type, representing when the license session ended (check-in).

  3. Then, add a required-fields code block under matchobjects section.

    required-fields Configuration Syntax
    required-fields
    {
        type=string
        value=time|duration
        start-time
        {
            type=string
            value=<start_time>
        }
        end-time
        {
            type=string
            value=<exit_time>
        }
    }

    where:

    Parameter Description
    <start_time> Refers to the field name representing the check-out time.
    <exit_time> Refers to the field name representing the check-in time.
    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.oconf
    root
    {
        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 to start-time, representing when the license session began (check-out), and the Exit Time is assigned to end-time, representing when the license session ended (check-in).

  4. 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.
Example: CSV Log File Content
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 timestamp 2023-01-05 13:07:47, while the Deactivated 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 the Deactivated field contains a timestamp 2023-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.

  1. 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 named matchobjects-event-zoo.oconf.

  2. Add a required-fields code block under matchobjects section.

    required-fields Configuration Syntax
    required-fields
    {
        type=string
        value=time|duration
        checkout_time
        {
            type=string
            value=Activated
        }
        checkin_time
        {
            type=string
            value=Deactivated
        }
    }

    where:

    Parameter Description
    checkout_time Specifies the variable used to set the check-out time.
    checkin_time Specifies the variable used to set the check-in time.
    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.oconf
    root
    {
        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 to checkout_time, indicating the timestamp when the license was activated (check-out), while the Deactivated field is mapped to checkin_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:

  1. 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 named matchobjects-event-moldex3d.oconf.

  2. Add a skip-line child node under matchobjects section.

    skip-line Configuration Syntax
    skip-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:

    Parameter Description
    <regex_pattern_to_skip> Specifies the pattern to skip.
    Parameters for Configuring Match Objects

    Example:

    Suppose the log file contains lines such as Moldex3DUsageLog - Start or Create time: 2024-04-01 12:00:00 that are irrelevant for parsing. You can configure the match object to skip these lines by adding a skip-line block as shown below:

    Example: matchobjects-event-moldex3d.oconf
    root
    {
        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 with File=Moldex3DUsageLog, such as File=Moldex3DUsageLog_20200401.csv,,,,,,.
    • The second match-regex skips any line that begins with Create time, such as Create 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.

We value your feedback!

Please take a few minutes to complete our survey and share your thoughts on your recent experience with our documentation.

Take survey

Close