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
- Host: GitHub
- URL: https://github.com/pvital/lopu
- Owner: pvital
- License: mit
- Created: 2020-04-02T12:38:18.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-24T20:53:24.000Z (almost 6 years ago)
- Last Synced: 2025-01-23T01:29:44.605Z (over 1 year ago)
- Topics: hacktoberfest, logging, parser
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.

[](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
```