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.
First, check if your OS distro already provides an installable diff-logs
package.
Otherwise:
- Star, download or clone repo.
- (Optional) Create a symlink in your bin-dir pointing to
diff-logs
shell script: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
$ diff-logs --help
Usage: diff-logs < FILE1.log # Print log file diff-friendly
diff-logs FILE1.log FILE2.log # Invoke $DIFFTOOL (e.g. diff)
diff-logs FILE1 FILE2 # Invokes `diff`
# or
export DIFFTOOL=meld
diff-logs FILE1 FILE2 # Invokes `meld`
diff-logs < FILE1 > FILE1.clean
Finally, we can diff our logs with ease! 🥳
Improvements welcome!