大家好,波哥又来了!~今天给大家推荐一个贼香的开源项目.一个轻便的日志高亮工具.
Tailspin 是一个开源的命令行工具,用于实时查看和搜索日志文件。该项目的代码托管在 GitHub 上,Tailspin 是用 Rust 编写的,旨在提供类似于 Unix 系统中 tail -f 命令的功能,但增加了更多高级特性,以便更高效地处理日志文件。
Tailspin 是一个用 Rust 编写的命令行工具,旨在提供类似 Unix 系统中 tail -f 命令的功能,但它在此基础上进行了优化和扩展,以便更好地处理大文件和复杂的日志分析工作。
要安装 Tailspin,可以使用 Cargo(Rust 的包管理器和构建系统)进行安装:
# Homebrew
brew install tailspin
# Cargo
cargo install tailspin
# Archlinux
pacman -S tailspin
# Nix
nix-shell -p tailspin
# NetBSD
pkgin install tailspin
# FreeBSD
pkg install tailspin
安装完成后,可以在命令行中使用 tailspin 命令。例如:
# Read from file and view in `less`
tspin application.log
# Read from file and print to stdout
tspin application.log --print
# Read from stdin and print to stdout
echo "2021-01-01 12:00:00 [INFO] This is a log message" | tspin
# Read from another command and print to stdout
kubectl logs [pod name] --follow | tspin
这将实时跟踪并显示 /var/log/syslog 文件的内容。
示例
项目地址
https://github.com/bensadeh/tailspin