# tailspin

> Log file highlighter (binary: tspin) that colors dates, numbers, IPs, UUIDs, URLs and more in any log format, with no config, and pages output through less.

Stars: 8.0k · Language: Rust · License: MIT · Categories: Dev Tools

- Repository: https://github.com/bensadeh/tailspin
- Page: https://www.trmn.sh/tools/tailspin

## Install

- Homebrew: `brew install tailspin`
- Cargo: `cargo install tailspin`
- Scoop: `scoop install tailspin`

## Overview

tailspin is a log file highlighter whose binary is named `tspin`. It reads a log file line by line and runs a set of matchers against each line, recognizing dates, durations, numbers, severity keywords, URLs, IPv4 addresses, UUIDs, Unix file paths, HTTP methods, quoted strings, key-value pairs, pointer addresses and Unix processes. It makes no assumptions about log format or field position, so it needs no configuration and highlights consistently across different log files.

By default, `tspin application.log` opens the highlighted file in `less`. When input is piped in, it prints to stdout instead, as in `kubectl logs -f pod_name | tspin` or `journalctl -f | tspin`. The `--exec` flag runs a command in the background and shows its output in `less`, for example `tspin --exec 'kubectl logs -f pod_name'`. The `-f`/`--follow` flag tails a file, and the `TAILSPIN_PAGER` environment variable swaps in a different pager.

Highlight groups can be toggled with `--enable` and `--disable`. Extras such as `ipv6` and `jvm-stack-trace` are added with `--extras` or the `TAILSPIN_EXTRAS` variable. Styles are customized in `~/.config/tailspin/theme.toml`, which can be generated with `tspin --generate-default-theme`. The theme file also supports custom keywords and regex highlighters with one capture group. Ad hoc keyword highlighting is available from the command line, e.g. `--highlight=red:error,fail`. It is aimed at developers, SREs and anyone reading application logs, kubectl output or system logs in a terminal. It is also available as a Rust crate.

### Installation

```bash
# via Homebrew
brew install tailspin
```

```bash
# via Cargo
cargo install tailspin
```

```bash
# via Scoop
scoop install tailspin
```

![tailspin highlighting a log file](https://media.trmn.sh/cached/f2f589646a02308c3593f6a0b63ebf4138f1fb60372b9951769892e598b36af1.png)

![tailspin custom on-the-fly highlights](https://media.trmn.sh/cached/cd16786ce57f61017ce283cec7e0d9ab35bf46a5f0ea9f11104c50569da0ef37.png)

## Alternatives

- [grex](https://www.trmn.sh/tools/grex.md): CLI tool that generates regular expressions from user-provided test cases automatically (Rust, 8.3k stars)
- [sd](https://www.trmn.sh/tools/sd.md): Find and replace CLI tool with regex support, string-literal mode, and faster performance than sed (Rust, 7.4k stars)
- [watchexec](https://www.trmn.sh/tools/watchexec.md): File watcher that runs commands when files change, with .gitignore support and cross-platform filesystem monitoring (Rust, 7.3k stars)
- [zizmor](https://www.trmn.sh/tools/zizmor.md): Static analysis tool that finds and fixes security issues in CI/CD configurations, including GitHub Actions workflows, Dependabot, and pre-commit. (Rust, 6.8k stars)
- [tealdeer](https://www.trmn.sh/tools/tealdeer.md): Fast Rust implementation of tldr providing simplified, example-based manual pages for command-line tools (Rust, 6.6k stars)

---

Canonical: https://www.trmn.sh/tools/tailspin
