mend-log-parser

command module
v23.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

Logo

License Go Reference

Mend Log Parser

A utility written in Go for quick identification and resolution of issues in Mend log files.

Supported Operating Systems
  • Windows: 10, 2012, 2016
  • Linux: Ubuntu 22.04
  • Mac: Requires that the user manually trust the binary
Prerequisites
  • The built binary for mend-log-parser.
    • You can install with: go install github.com/mend-toolkit/mend-log-parser/v23@latest or
    • You can download the latest release here.
  • A log file for analysis.
Installation in Mac

In order to run the binary on a Mac computer, after downloading, the following command needs to be run to trust the binary:

sudo xattr -dr com.apple.quarantine $(realpath mend-log-parser) 

Evolution of the tool

The Mend Log Parser is considered a living tool, in the fact that the base code defines a simple way of analyzing log files, while Mend and the end user can specify search terms for log files that are being analyzed. These search terms are called "Search Filters" The strings are supplied in the mend-settings.config file and are evaluated in one of two ways:

  1. Contains - In this method, a normal string is supplied, and then the log parser searches for this string specifically within the log file.
  2. Regex - With this search method, users can specify regex: at the beginning of a string, and then everything after that is the regex that needs to be matched.

Arguments

The following are possible command-line arguments when running mend-log-parser

Flag (shorthand / original) Type Required Default Description
-f, --file string True N/A The path to the log file that needs analyzed.
--filter string False N/A The search string you would like to search for. To use a regex, start with "regex:". If set, then it ignores filters provided in the configuration file.
-c, --config string False ./mend-settings.config if present in the local directory. Otherwise: this location Config file location. If this is a URL, it must return the configuration file in plaintext.
-lba, --lines-before-after integer False 3 Number of lines to display before and after the message evaluated from a search term.
-lb, --lines-before integer False 3 Number of lines to display before the message evaluated from a search term.
-la, --lines-after integer False 3 Number of lines to display after the message evaluated from a search term.
-nc, --no-color flag False False When set, directs the output to not use color.

Search Filters

Search Filters are definitions provided in the mend-settings.config files above that tells mend-log-parser how to behave when searching with each filter. The following columns are:

  1. Search Filter String - Required - The full search terms of the filter. Start with regex: to denote a Regular Expression.
  2. Documentation URL - Not Required - The Documentation URL where you can read more about an issue and how to fix it. This can also contain a simple message

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL