codecov Version AUR CICD pre-commit

snazy - a snazzy log viewer

Snazy is a simple tool to parse json or other type of logs and output them in a nice format with nice colors.

As a tekton and pipelines-as-code developer who has to dig into controller/webhook logs all the time I wanted something that is a bit easier to look in the eyes and identify error/info/warning statements easily.

You do not have to use it only with tekton but work well with projects that uses go-uber/zap library like knative and many others.

It can work as a super-"tail" too if you want to stream logs and being able to have "actions" or "highlights" on a regexp match.

Screenshot

screenshot

Installation

Binaries

Go to the release page and grab the archive or package targeting your platform.

Homebrew

shell brew tap chmouel/snazy https://github.com/chmouel/snazy brew install snazy

Crates.io

shell cargo install snazy

Arch

With your favourite aurhelper for example yay :

shell yay -S snazy-bin

Nix/NixOS

This repository includes a flake (see NixOS Wiki on Flakes).

If you have the nix flake command enabled (currenty on nixos-unstable, nixos-version >= 22.05)

shell nix run github:chmouel/snazy -- --help # your args are here

You can also use it to test and develop the source code:

shell nix develop # drops you in a shell with all the thing needed nix flake check # runs cargo test, rustfmt, …

Docker

shell kubectl logs deployment/pod foo|docker run -i ghcr.io/chmouel/gosmee

Build from source

Snazy is build with rust, if you want to compile it directly you just need to grab the source and run cargo build.

Usage

shell kubectl logs deployment/controller|snazy

screenshot

shell % kubectl log pod|snazy -f warning -f error

snazy level symbols

Interactive filtering with fzf

You can go even further with unix shell pipelines, and feed snazy to fzf for interactive filtering of the stream. for example to stream everything on a kubernetes cluster with kail, transforming the logs via snazy and finally using fzf to interactively select the patter to match:

shell kail --since=1h | snazy | fzf +s --ansi

This will give you a prompt with fzf where you can type the query you want.

Shell completions

Shell completions are available for most shells in the misc/completions and it will be automatically installed with the aur/brew package.

FAQ

Copyright

Apache-2.0

Authors

Chmouel Boudjnah <@chmouel>