https://github.com/mbobakov/stutterlog
Search for duplicates in your log via Damerau-Levenshtein distance
https://github.com/mbobakov/stutterlog
analyzer cli-utilities golang logging
Last synced: 4 months ago
JSON representation
Search for duplicates in your log via Damerau-Levenshtein distance
- Host: GitHub
- URL: https://github.com/mbobakov/stutterlog
- Owner: mbobakov
- License: mit
- Created: 2017-02-02T16:24:32.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-02T17:26:21.000Z (over 9 years ago)
- Last Synced: 2024-06-20T12:45:47.643Z (about 2 years ago)
- Topics: analyzer, cli-utilities, golang, logging
- Language: Go
- Homepage:
- Size: 697 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://goreportcard.com/report/github.com/mbobakov/stutterlog) [](https://travis-ci.org/mbobakov/stutterlog)
# stutterlog
'''stutterlog''' is dead simple tool for search for dublicates in the log.
It's use [Damerau-Levenshtein distance](https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance) for finding almost same log lines.
### Install
``` go get https://github.com/mbobakov/stutterlog```
or download via releases page
### Usage
Usage of ./stutterlog:
-debug
Debug output. WARNING! this cause huge output
-dist int
Minimal Damerau-Levenshtein distance to match (default 20)
-top int
How many lines will be shown (default 10)
### Examples
Let's me show how it works. For example we have log file like this:
2015-03-26T01:27:38-04:00 debug trash message with tr@sH
2015-03-26T01:27:39-04:00 info status of id=1 is OK
2015-03-26T01:27:42-04:00 info status of id=2 is OK
2015-03-26T01:27:44-04:00 debug trash message with t4H
2015-03-26T01:27:44-04:00 info status of id=3 is OK
2015-03-26T01:27:45-04:00 debug trash message with t7H
You can pass logs via stdin or as argument:
mbobakov$> cat test | ./stutterlog
----------------------------------
- Line Example: '2015-03-26T01:27:38-04:00 debug trash message with tr@sH'
Matches: 2
Average Levenstein distance: 5.000000
----------------------------------
- Line Example: '2015-03-26T01:27:39-04:00 info status of id=1 is OK'
Matches: 2
Average Levenstein distance: 3.000000
### Performance
On 2 GHz Intel Core i7 / 8 GB 1600 MHz DDR3 / SSD. 1000 log lines with 512 symbols for each
mbobakov$> time ./stutterlog 1000linedFile.log > /dev/null
1.07 real 1.10 user 0.02 sys
### Contibuting
Go >= 1.7 is requirement. This tool use [dep](https://github.com/golang/dep) for dependency management. Pull Request are welcome. ;)