An open API service indexing awesome lists of open source software.

https://github.com/pvital/lopu

LOg Parsing Utility
https://github.com/pvital/lopu

hacktoberfest logging parser

Last synced: over 1 year ago
JSON representation

LOg Parsing Utility

Awesome Lists containing this project

README

          

# lopu - LOg Parsing Utility

lopu is a Python CLI application that helps you parse log files of various
kinds.

![testing](https://github.com/pvital/lopu/workflows/testing/badge.svg)
[![Build Status](https://travis-ci.org/pvital/lopu.svg?branch=master)](https://travis-ci.org/pvital/lopu)

```
Usage: ./lopu.py [OPTION]... [FILE]
-h, --help Print help
-f, --first=NUM Print first NUM lines
-l, --last=NUM Print last NUM lines
-t, --timestamps Print lines that contain a timestamp in HH:MM:SS format
-i, --ipv4 Print lines that contain an IPv4 address, matching IPs
are highlighted
-I, --ipv6 Print lines that contain an IPv6 address (standard
notation), matching IPs are highlighted
```

If FILE is omitted, standard input is used instead.

If multiple options are used at once, the result is the intersection of their
results.

## Example supported usage:

```
./lopu.py -h

cat test_0.log | ./lopu.py --first 10

./lopu.py -l 5 test_1.log

./lopus.py --timestamps test_2.log

./lopu.py --ipv4 test_3.log

./lopu.py --ipv6 test_4.log

./lopu.py --ipv4 --last 50 test_5.log

```

## Testcases

To execute our suite of unit tests, execute the following command:

```
python3 -m unittest tests/test_lopu.py
```