https://github.com/kernc/diff-logs
Shell utility for viewing differences between log files
https://github.com/kernc/diff-logs
bash build-log ci ci-cd continuous-integration devops-tools devtool devtools diff logfiles logging logs unix visualize-differences
Last synced: 19 days ago
JSON representation
Shell utility for viewing differences between log files
- 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: 2025-01-21T07:59:20.000Z (3 months ago)
- Last Synced: 2025-03-27T15:12:24.388Z (about 1 month ago)
- Topics: bash, build-log, ci, ci-cd, continuous-integration, devops-tools, devtool, devtools, diff, logfiles, logging, logs, unix, visualize-differences
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
`diff-logs`
===========
[](https://github.com/kernc/diff-logs/actions)
[](https://github.com/kernc/diff-logs)
[](https://github.com/kernc/diff-logs)
[](https://github.com/kernc/diff-logs)
[](https://github.com/kernc/diff-logs)
[](#)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!