Metadata-Version: 2.1
Name: bmo-log-parse
Version: 0.4.0
Summary: Utility for filtering and displaying logs from the Metal³ baremetal-operator.
Home-page: https://github.com/zaneb/bmo-log-parse
Author: Zane Bitter
Author-email: zbitter@redhat.com
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: POSIX
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: Topic :: System :: Logging
Classifier: Topic :: Text Processing :: Filters
Requires-Python: >=3.6
License-File: LICENSE
Requires-Dist: autopage
Requires-Dist: PyYAML

# Metal³ baremetal-operator log parser

This is tool to produce human-readable logs from the structured log output of
the [baremetal-operator](https://github.com/metal3-io/baremetal-operator) from
the [Metal³](https://metal3.io/) project.

It is written in Python and requires Python 3.6 or later.

## Installation

### On Fedora or CentOS/RHEL

Distro packages are available in Copr:

```bash
sudo dnf copr enable zaneb/autopage
sudo dnf install python3-bmo-log-parse
```

### Everywhere else

Install using pip:

```bash
pip3 install --user git+https://github.com/zaneb/bmo-log-parse
```

This automatically installs dependencies also. (Specifically, the
[autopage](https://pypi.org/project/autopage/) library is a requirement.)

## Usage

By default, the tool reads from stdin and writes to stdout. It can be used with
either an existing log file or a `tail -f`-style stream. If the output is not
piped or redirected, a pager is automatically invoked.

Several filters are available to winnow the output.


    usage: bmo-log-parse [-h] [-c [CONTROLLER] | -p | -w [WEBHOOK]] [--error]
                         [--verbose] [-n NAME] [--namespace NAMESPACE]
                         [-s START] [-e END] [--list-names]
                         [logfile]


    positional arguments:
      logfile               Input logfile (or "-" to read stdin)

    options:
      -h, --help            show this help message and exit
      -c [CONTROLLER], --controller-only [CONTROLLER]
                            Include only controller module logs
      -p, --provisioner-only
                            Include only provisioner module logs
      -w [WEBHOOK], --webhook-only [WEBHOOK]
                            Include only webhook logs
      --error               Include only logs at ERROR level
      --verbose             Include verbose error logs
      -n NAME, --name NAME  Filter by a particular host name
      --namespace NAMESPACE
                            Filter by a particular host namespace
      -s START, --start START
                            Skip ahead to a given time
      -e END, --end END     Stop reading at a given time
      --list-names          List the names of hosts in the log

## Testing

Run the unit tests using `tox`.
