Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kernc/diff-logs
Command-line utility for diff'ing all kinds of logs.
https://github.com/kernc/diff-logs
bash devops-tools devtool devtools diff logfiles logging logs unix visualize-differences
Last synced: 4 months ago
JSON representation
Command-line utility for diff'ing all kinds of logs.
- Host: GitHub
- URL: https://github.com/kernc/diff-logs
- Owner: kernc
- Created: 2023-10-25T01:03:20.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-13T00:30:17.000Z (12 months ago)
- Last Synced: 2024-05-01T20:37:00.189Z (9 months ago)
- Topics: bash, devops-tools, devtool, devtools, diff, logfiles, logging, logs, unix, visualize-differences
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
`diff-logs`
===========
[![Build Status](https://img.shields.io/github/actions/workflow/status/kernc/diff-logs/ci.yml?branch=master&style=for-the-badge)](https://github.com/kernc/diff-logs/actions)
[![](https://img.shields.io/github/issues/kernc/diff-logs?style=for-the-badge)](#)A command-line utility for diff'ing log files.
Quickly find diffing lines in all kinds of logs,
namely build/CI logs, server/container logs or any such.
Figure out _why exactly_ the shit is failing quickly.The script works by replacing common stochastic string [patterns],
such as datetime timestamps, download speeds, temporary files,
HTTP header values, UUIDs, hash digests etc., with known fixed
values that a tool such as `diff` can then easily skip.[patterns]: https://github.com/kernc/diff-logs/blob/master/diff-logs.py
Installation
------------
First, check if your OS distro already provides an installable `diff-logs` package.Otherwise:
1. Star, [download](https://github.com/kernc/diff-logs/archive/refs/heads/master.zip)
or clone repo.
2. (Optional) Create a symlink in your bin-dir pointing to `diff-logs` shell script:
```shell
mkdir -p ~/.local/bin
export PATH="~/.local/bin:$PATH" # Also put in .bashrc or similar
# Link script into your bin
ln -s ~/path/to/diff-logs/diff-logs ~/.local/bin/diff-logs
```Usage
-----
```shell
$ diff-logs --helpUsage: diff-logs < FILE1.log # Print log file diff-friendly
diff-logs FILE1.log FILE2.log # Invoke $DIFFTOOL (e.g. diff)
```Examples
--------
### Diff two log files
```shell
diff-logs FILE1 FILE2 # Invokes `diff`
# or
export DIFFTOOL=meld
diff-logs FILE1 FILE2 # Invokes `meld`
```### Diff-friendly-format a single log file
```shell
diff-logs < FILE1 > FILE1.clean
```-----
Finally, we can diff our logs with ease! 🥳Improvements welcome!