README
¶
Terminal user interface for reading logs from journalctl
, file system, Docker and Podman containers, as well Kubernetes pods for quick viewing and filtering with fuzzy find (like fzf
), regex support (like grep
) and coloring the output, written in Go with the awesome-gocui (fork gocui) library.
This tool is inspired by and with love for LazyDocker and LazyGit, as well as is included in Awesome-TUIs and Awesome-Docker, check out other useful projects on the repository pages.
Functional
- Simple installation, download one executable file without dependencies for starting.
- List of all units (
services
,sockets
, etc.) viasystemctl
with current running status. - View all system and user journals via
journalctl
(tool for reading logs from systemd-journald). - List of all system boots for kernel log output.
- File system logs (example, for
Apache
orNginx
), as well assyslog
ormessages
,dmesg
for kernel logs, etc. - List of all log files of descriptors used by processes, as well as all log files in the home directories of users.
- Reading archived logs (
gz
,xz
orbz2
format), packet capture (pcap
format) and Apple System Log (asl
format). - Docker containers (including
timestamp
andstderr
), Podman pods and the Docker Swarm services. - Kubernetes pods via
kubectl
- Windows Event Logs (in test mode via
powershell
and reading viawevtutil
) and application logs from Windows file system. - Filtering lists to find the desired journal.
- Displays the currently selected log output in real-time.
Supports 3 filtering modes:
- Default - case sensitive exact search.
- Fuzzy - custom inexact case-insensitive search (searches for all phrases separated by a space anywhere on a line).
- Regex - search with regular expression support (based on the built-in regexp library), case insensitive by default (in case a regular expression syntax error occurs, the input field will be highlighted in red).
Supported coloring groups for output:
- Green - keywords indicating success.
- Red - keywords indicating an error.
- Blue - statuses (info, debug, etc), actions (install, update, etc) and HTTP methods (GET, POST, etc).
- Light Blue - numbers (date, time, bytes, ip and mac-addresses).
- Yellow - known names (host name and system users) and warnings.
- Purple - url and full paths in the file system.
- Custom - unix processes.
Install
Binaries are available for download on the releases page.
List of supported systems and architectures in which functionality is checked:
OS | amd64 | arm64 | Systems |
---|---|---|---|
Linux | ✔ | ✔ | Raspberry Pi (aarch64 ), Oracle Linux (RHEL-based in WSL environment), Arch Linux, Rocky Linux, Ubuntu Server 20.04.6 and above |
Darwin | ✔ | ✔ | macOS Sequoia 15.2 x64 on MacBook and the arm64 in GitHub Actions |
BSD | ✔ | OpenBSD 7.6 and FreeBSD 14.2 | |
Windows | ✔ | Windows 10 and 11 |
Unix-based
Run the command in the console to quickly install or update the stable version for Linux, macOS or the BSD-based system:
curl -sS https://raw.githubusercontent.com/Lifailon/lazyjournal/main/install.sh | bash
This command will run a script that will download the latest executable from the GitHub repository into your current user's home directory along with other executables (or create a directory) and grant execution permission.
Arch Linux
If you an Arch Linux user you can also install from the AUR:
paru -S lazyjournal
Thank you Matteo Giordano for upload and update the package in AUR.
Conda / mamba / pixi (Linux / macOS / Windows)
If you use package managers like conda or mamba, you can install lazyjournal from conda-forge:
conda install -c conda-forge lazyjournal
mamba install -c conda-forge lazyjournal
You can install lazyjournal user-globally using pixi:
pixi global install lazyjournal
Homebrew (macOS / Linux)
Use the following command to install lazyjournal using Homebrew:
brew install lazyjournal
Thank you Ueno M. for upload and update the package in homebrew and conda.
Windows
Use the following command to quickly install in your PowerShell console:
irm https://raw.githubusercontent.com/Lifailon/lazyjournal/main/install.ps1 | iex
The following directories are used to search for logs in the file system:
Program Files
Program Files (x86)
ProgramData
AppData\Local
andAppData\Roamin
for current user
To read logs, automatic detection of the following encodings is supported:
UTF-8
UTF-16 with BOM
UTF-16 without BOM
Windows-1251
by default
Go Package
You can also use Go for install the dev version (Go must be installed in the system):
go install github.com/Lifailon/lazyjournal@latest
Others
If you use other packag manager and want this package to be present there as well, open an issue or load it yourself and make Pull requests.
Usage
You can run the interface from anywhere:
lazyjournal # Run interface
lazyjournal --help, -h # Show help
lazyjournal --version, -v # Show version
lazyjournal --audit, -a # Show audit information
Access to all system logs and containers may require elevated privileges for the current user.
Build
Clone the repository and run the project:
git clone https://github.com/Lifailon/lazyjournal
cd lazyjournal
go run main.go
Use make or go-task to build binaries for different platforms and systems:
make build
# or
task build
Check the source code on the base linters using golangci-lint (including critic and security):
make lint
Testing
Run unit tests to check functions and their performance:
go test -v
The test coverage report using CI Actions for Linux, macOS and Windows systems is available on the Wiki page.
Testing in BSD-based systems is done in a home environment using usup.
Hotkeys
Tab
- switch between windows.Shift+Tab
- return to previous window.Left/Right
- switch between journal lists in the selected window.Enter
- selection a journal from the list to display log output.<Up/PgUp>
and<Down/PgDown>
- move up and down through all journal lists and log output, as well as changing the filtering mode in the filter window.<Shift/Alt>+<Up/Down>
- quickly move up and down through all journal lists and log output every10
or100
lines (500
for log output).<Shift/Ctrl>+<U/D>
- quickly move up and down (alternative for macOS).Ctrl+A
orHome
- go to top of log.Ctrl+E
orEnd
- go to the end of the log.Ctrl+W
- clear text input field for filter to quickly update current log output without filtering.Ctrl+C
- exit.
Contributing
Since this is my first Go project, there may be some bad practices, BUT I want to make LazyJournal better. Any contribution will be appreciated! If you want to implement any new feature or fix something, please open an issue first.
Alternatives
- lnav - The Logfile Navigator is a log file viewer for the terminal.
- Dozzle - is a small lightweight application with a web based interface to monitor Docker logs.
If you like using TUI tools, try multranslate for translating text in multiple translators simultaneously and LLM, with support for translation history and automatic language detection.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Copyright (C) 2024 Lifailon (Alex Kup)
Documentation
¶
There is no documentation for this package.