How to Extract Fields during Log Import in EventLog Analyzer

How to Extract Fields during Log Import in EventLog Analyzer

Objective

 Log import offers you an option to import logs from custom application or non predefined supported log sources. This article offers you the steps to extract fields during log import in EventLog Analyzer. It will guide you through the process of defining and extracting specific fields from log files to ensure that log data is properly parsed and help you in analysis or building custom reports/alerts.

Prerequisites

  • Access to EventLog Analyzer user interface as Administrator or Custom role to Import Log file and create parser rule.
  • Log files from the source systems (e.g., servers, applications) that need to be imported
  • Knowledge of the log source path, file type, event type and values in them to create parser rule.

Steps to follow

  1. Log in to EventLog Analyzer
  2. Navigate to Settings >> Log source configuration >> Import Log .
  3. Choose the method of which you want to import the file(Local/Remote/S3 bucket) and select the file. Refer to Related articles to get additional help.
  4. Set the required Log format(Can be a predefined or custom format that you have created earlier) or create a new log format in the drop down box for which the log has to be imported.  Refer How to create Log format during import to know the steps.
NOTE: The extracted fields or parser rule will be mapped to the log format you have selected. If you choose Automatically Identify, the application will attempt to match the imported file with an existing format and determine the appropriate log format for you. If no match is found, a new custom log format will be created, named <FILENAME>_custom.
  1. Place the cursor on top of the file name and choose View logs/Extract fields option
  1. You can notice the Log Type value in the top right corner or in the fields which states which Log format is applied for the file selected. Place your cursor on top of any event and choose Create Additional Fields to start extraction.
In the above image the EventLog Analyzer does not identify the log format and hence created custom format with the format as <FILENAME>_custom
7. There are three methods by which custom fields can be specified.
    1. Regex method
    2. Delimiter method
    3. JSON method

 Regex Method
 

  1. Provide a rule name.
  2. Select and click the word(s) in the message, to be extracted as a field.
  3. You can use the Auto Identify option to identify the fields automatically.
  1. Provide a name for this field. Optionally, specify the prefix and suffix to the field value. Refer How to add Prefix and Suffix to know more.
  2. Click on Create Pattern to generate a parser rule pattern.
  1. A parser rule pattern is created using the field definition. You can edit the generated pattern manually if you are familiar with regular expressions.
  2. Validate link is used to test the generated pattern against the previous search results. You can manually check the suitability of the pattern by analyzing the 'Matched Log Messages' and 'Unmatched Log Messages' displayed.
  3. Click on Choose another pattern to choose a pattern from the list of patterns generated by the application.
  4. You can define any existing field matching criteria to apply the pattern for this specific log type.
  5. Save the pattern to extract the field(s) from the upcoming logs.

 Delimiter Method

  1. Provide a rule name.
  2. You can use the Delimiter to extract fields using delimiters such as Space, Comma, Tab, or Pipe. You can also use the text box in the drop down to enter a Custom Delimiter, which can split the field values.
  3. Click Save rule to save the created rule and have them applied for upcoming logs.

JSON Method

  • For JSON format logs, users can extract fields by specifying the JSON path to target specific fields in the log. Each field is defined by assigning a field name and mapping it to its corresponding JSON path. It's important to note that the JSON path should accurately reference the key or nested structure within the JSON log.
  • JSON field extraction can be configured only for the File Import custom log format. Users can create JSON extraction rules in the following two ways:
    • With a Sample Log:
  • Provide a valid JSON log.
  • Select the required fields from the JSON tree.
  • Assign field names for the corresponding JSON paths.
Without a Sample Log:
  • Manually specify the JSON path to target specific fields.
  • Ensure the JSON path matches the log structure.
  1. Once you extract the field, it will be visible as custom field in right pane and you will be able to see the field with values.
  1. Follow the above steps to create desired fields and Save the option to take effect.
 Validation and confirmation: 
  • Open Search tab, select the device, set the calendar date and time as per log and perform search. Verify that the new fields are extracted by searching the field name under Add/Remove Field option.
  • Ensure that the extracted data is displayed correctly and matches the expected values.

 Tips

  • Logs imports will be parsed based on the Log format selected. If a log format is created new, application will remember the format and will be used during Auto identification.
  • Newly extracted fields will be applicable only for new logs collected. Old logs will not contain the parsed value.
  • Newly extracted fields will be mapped to respective Log format which can be seen under Settings >> Admin Settings >> Custom Log formats.
  • You can  create a new log format during import  using the following steps.
    • Choose Automatically Identify drop down
    • Enter a new Log Format name and choose + option near the text box to add it.
  • New fields can be used in Reports, Search and Alerts tab and can be used for custom reports, Custom Alerts, Custom Action/Rule creation.
  • You can  add Prefix/sufix  in Regix to build the pattern easily.
    • You can also include the prefix and/or suffix of a field value to improve precision. To include a prefix and/or suffix, click on the icon in the right corner of the Fields table and select the required option. Click Apply.
    • For instance, consider the message : Successful Network Logon: User Name: sylvian Domain: ADVENTNET Logon ID: (0x0,0x6D51131) Logon Type: 3 Logon Process: NtLmSsp Authentication Package: NTLM Workstation Name: SYLVIAN Logon GUID: - Caller User Name: - Caller Domain: - Caller Logon ID: - Caller Process ID: - Transited Services: - Source Network Address: 192.168.113.97 Source Port: 0 22873
    • The prefix Logon Type can be a static value as most of the logs will have the exact word as Logon Type where as Source Network Address can be dynamic as the logs may have different word(s) like, Source IP Address, Source Address, but with the same pattern.
    • If the prefix and suffix are defined with exact match, the field extraction will be precise.
Note: An open attribute will not have a prefix or suffix.
 

Related topics and articles


                  New to ADSelfService Plus?

                    • Related Articles

                    • How to Extract New/Custom Fields from Log Data Using Log Search in EventLog Analyzer

                      Objective This article offers you the steps to extract new fields from log data in EventLog Analyzer. It will guide you through the process of defining and extracting custom fields to enhance log analysis and reporting. Prerequisites Access to ...
                    • How to enable audit for PostgreSQL logs in EventLog Analyzer

                      Objective EventLog Analyzer can audit PostgreSQL logs via log import feature, This article focuses on how to import the PostgreSQL logs via log import in EventLog Analyzer. Prerequisites Availability of license purchased. For build lower than 13000 - ...
                    • How to create Custom Parser Format in EventLog Analyzer

                      Objective Creating Custom Log format option is available in EventLog Analyzer from build 12435 onwards, which offers you a flexibility to create your own Log formats. You can create multiple custom parsing rules within them to extract multiple fields ...
                    • How to enable audit for SAP ERP audit logs in EventLog Analyzer

                      Objective EventLog Analyzer can audit SAP ERP logs via log import feature, This article focuses on how to import the SAP ERP logs via log import in EventLog Analyzer. Prerequisites Availability of license purchased. For build lower than 13000 - ...
                    • How to import logs in EventLog Analyzer from Remote path

                      Objective Some applications might record logs in the file system so the user can import the logs into EventLog Analyzer. These logs must be located in the Local file system of the EventLog Analyzer instance with the shared path of Windows OS and ...