mirror of
https://github.com/Lifailon/lazyjournal.git
synced 2026-11-11 01:09:46 +01:00
update for 0.7.8
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
<a href="https://raw.githubusercontent.com/wiki/Lifailon/lazyjournal/coverage.html"><img title="Go coverage report"src="https://raw.githubusercontent.com/wiki/Lifailon/lazyjournal/coverage.svg"></a>
|
||||
<a href="https://goreportcard.com/report/github.com/Lifailon/lazyjournal"><img src="https://goreportcard.com/badge/github.com/Lifailon/lazyjournal" alt="Go Report"></a>
|
||||
<a href="https://pkg.go.dev/github.com/Lifailon/lazyjournal"><img src="https://pkg.go.dev/badge/github.com/Lifailon/lazyjournal.svg" alt="Go Reference"></a>
|
||||
<a href="https://github.com/Lifailon/Kinozal-Bot/blob/rsa/LICENSE"><img title="License"src="https://img.shields.io/github/license/Lifailon/Kinozal-Bot?logo=readme&color=white"></a>
|
||||
<a href="https://github.com/avelino/awesome-go"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Go"></a>
|
||||
<a href="https://github.com/Lifailon/lazyjournal/blob/rsa/LICENSE"><img title="License"src="https://img.shields.io/github/license/Lifailon/lazyjournal?logo=readme&color=white"></a>
|
||||
<!-- <a href="https://github.com/avelino/awesome-go"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Go"></a> -->
|
||||
<br>
|
||||
<a href="https://aur.archlinux.org/packages/lazyjournal"><img title="Arch Linux" src="https://img.shields.io/aur/version/lazyjournal?logo=arch-linux&color=blue&label=AUR"></a>
|
||||
<a href="https://anaconda.org/conda-forge/lazyjournal"><img title="Conda Forge" src="https://img.shields.io/conda/vn/conda-forge/lazyjournal?logo=anaconda&color=green&label=Conda"></a>
|
||||
@@ -16,7 +16,7 @@
|
||||
<a href="https://hub.docker.com/r/lifailon/lazyjournal"><img title="Docker Hub" src="https://img.shields.io/docker/image-size/lifailon/lazyjournal/latest?logo=docker&color=blue&label=Docker+Hub"></a>
|
||||
</p>
|
||||
|
||||
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, regex support and coloring the output, written in Go with the [awesome-gocui](https://github.com/awesome-gocui/gocui) (fork [gocui](https://github.com/jroimartin/gocui)) library.
|
||||
Terminal user interface for reading logs from `journald`, `auditd`, file system, Docker containers, Podman and Kubernetes pods for quick viewing and filtering with fuzzy find, regex support and coloring the output, written in Go with the [awesome-gocui](https://github.com/awesome-gocui/gocui) (fork [gocui](https://github.com/jroimartin/gocui)) library.
|
||||
|
||||
This tool is inspired by and with love for [LazyDocker](https://github.com/jesseduffield/lazydocker) and [LazyGit](https://github.com/jesseduffield/lazygit). It is also included in [Awesome-Go](https://github.com/avelino/awesome-go?tab=readme-ov-file#logging), [Awesome-TUIs](https://github.com/rothgar/awesome-tuis?tab=readme-ov-file#development) and [Awesome-Docker](https://github.com/veggiemonk/awesome-docker?tab=readme-ov-file#terminal-ui), check out other useful projects on the repository pages.
|
||||
|
||||
@@ -27,23 +27,37 @@ This tool is inspired by and with love for [LazyDocker](https://github.com/jesse
|
||||
- Simple installation, to run download one executable file without dependencies and settings.
|
||||
- Centralized search for the required journal by filtering all lists (log sources).
|
||||
- Streaming output of new events from the selected journal (like `tail`).
|
||||
- List of all units (`services`, `sockets`, etc.) with current running status from `systemd` via `systemctl`.
|
||||
- List of all units (`services`, `sockets`, etc.) with current running status via `systemctl` from `systemd`.
|
||||
- View all system and user journals via `journalctl` (tool for reading logs from [journald](https://github.com/systemd/systemd/tree/main/src/journal)).
|
||||
- List of all system boots for kernel log output.
|
||||
- List of audit rules from `auditd` for filtering by keys and viewing in `interpret` format.
|
||||
- File system logs such as for `Apache` or `Nginx`, as well as `syslog`, `messages`, etc. from `/var/log`.
|
||||
- Lists all log files in users home directories, as well as descriptor log files used by processes.
|
||||
- Reading archive logs truncated during rotation (`gz`, `xz` and `bz2` formats), Packet Capture (`pcap` format) and Apple System Log (`asl` format).
|
||||
- Docker containers (including `timestamp` and `stderr`), Podman pods and the Docker Swarm services.
|
||||
- Kubernetes pods via `kubectl`.
|
||||
- Search and analyze all logs from remote hosts in one interface using [rsyslog](https://www.rsyslog.com) configuration.
|
||||
- Docker logs, including archive logs, timestamp and all streams.
|
||||
- Podman logs, without the need to run a background process (socket).
|
||||
- Kubernetes pods (need to configure a connection to the cluster via `kubectl` in advance).
|
||||
- Windows Event Logs via `PowerShell` and `wevtutil`, as well as application logs from Windows file system.
|
||||
|
||||
Supports 3 filtering modes:
|
||||
### Filtering
|
||||
|
||||
Supports 4 filtering modes:
|
||||
|
||||
- **Default** - case sensitive exact search.
|
||||
- **Fuzzy** (like `fzf`) - custom inexact case-insensitive search (searches for all phrases separated by a space anywhere on a line).
|
||||
- **Regex** (like `grep`) - search with regular expression support, based on the built-in [regexp](https://pkg.go.dev/regexp) library, case-insensitive by default (in case a regular expression syntax error occurs, the input field will be highlighted in red).
|
||||
- **Timestamp** - filter `since` and/or `until` by date and time for `journald`, docker and podman logs from streams. This mode affects the loading of the log (thereby increasing performance) and can be used in conjunction with other filtering modes, so the current log should be reloaded by pressing `Enter` in the current input field.
|
||||
|
||||
## Coloring
|
||||
Supported formats for `timestamp`:
|
||||
|
||||
- `00:00`
|
||||
- `00:00:00`
|
||||
- `2025-04-14`
|
||||
- `2025-04-14 00:00`
|
||||
- `2025-04-14 00:00:00`
|
||||
|
||||
### Coloring
|
||||
|
||||
Supported coloring groups for output:
|
||||
|
||||
@@ -52,7 +66,7 @@ Supported coloring groups for output:
|
||||
- **Green** - keywords indicating success.
|
||||
- **Red** - keywords indicating error.
|
||||
- **Blue** - statuses (info, debug, etc), actions (install, update, etc) and HTTP methods (GET, POST, etc).
|
||||
- **Light blue** - numbers (date, time, bytes, versions, percentage, integers, IP and MAC addresses).
|
||||
- **Light blue** - numbers (date, time, timestamp, bytes, versions, percentage, integers, IP and MAC addresses).
|
||||
|
||||
A full list of all keywords can be found in the [color.log](/color.log) file (used for testing only). If you have suggestions for improving coloring (e.g. adding new words), you can open an [issue](https://github.com/Lifailon/lazyjournal/issues) for a new feature.
|
||||
|
||||
@@ -81,13 +95,15 @@ curl -sS https://raw.githubusercontent.com/Lifailon/lazyjournal/main/install.sh
|
||||
|
||||
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.
|
||||
|
||||
Or you can install manually from `deb` or `snap` package:
|
||||
```bash
|
||||
curl -L -sS https://github.com/Lifailon/lazyjournal/releases/download/0.7.7/lazyjournal-0.7.7-amd64.deb -o /tmp/lazyjournal.deb
|
||||
sudo dpkg -i /tmp/lazyjournal.deb
|
||||
### Debian / Ubuntu
|
||||
|
||||
curl -L -sS https://github.com/Lifailon/lazyjournal/releases/download/0.7.7/lazyjournal-0.7.7-amd64.snap -o /tmp/lazyjournal.snap
|
||||
sudo snap install /tmp/lazyjournal.snap --dangerous --classic
|
||||
If you are using a Debian-based system, you can also install from the `deb` package:
|
||||
|
||||
```bash
|
||||
arch=$( [ "$(uname -m)" = "aarch64" ] && echo "arm64" || echo "amd64" )
|
||||
version=$(curl -L -sS -H 'Accept: application/json' https://github.com/Lifailon/lazyjournal/releases/latest | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
|
||||
curl -L -sS https://github.com/Lifailon/lazyjournal/releases/download/$version/lazyjournal-$version-$arch.deb -o /tmp/lazyjournal.deb
|
||||
sudo dpkg -i /tmp/lazyjournal.deb
|
||||
```
|
||||
|
||||
### Arch Linux
|
||||
@@ -128,6 +144,7 @@ To run the interface in a container, download [docker-compose](/docker-compose.y
|
||||
```shell
|
||||
mkdir lazyjournal && cd lazyjournal
|
||||
curl -sS https://raw.githubusercontent.com/Lifailon/lazyjournal/main/docker-compose.yml -o docker-compose.yml
|
||||
curl -sS https://raw.githubusercontent.com/Lifailon/lazyjournal/main/.env -o .env
|
||||
docker-compose up -d
|
||||
docker exec -it lazyjournal lazyjournal
|
||||
```
|
||||
@@ -179,19 +196,20 @@ go install github.com/Lifailon/lazyjournal@latest
|
||||
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
|
||||
lazyjournal --tail, -t Change the number of log lines to output (default: 100000, range: 5000-200000)
|
||||
lazyjournal --update, -u Change the auto refresh interval of the log output (default: 5, range: 2-10)
|
||||
lazyjournal --disable-color, -d Disable output coloring
|
||||
lazyjournal --command-color, -c Coloring in command line mode
|
||||
lazyjournal Run interface
|
||||
lazyjournal --help, -h Show help
|
||||
lazyjournal --version, -v Show version
|
||||
lazyjournal --audit, -a Show audit information
|
||||
lazyjournal --tail, -t Change the number of log lines to output (default: 50000, range: 200-200000)
|
||||
lazyjournal --update, -u Change the auto refresh interval of the log output (default: 5, range: 2-10)
|
||||
lazyjournal --disable-color, -d Disable output coloring
|
||||
lazyjournal --disable-timestamp, -s Disable timestamp for docker logs
|
||||
lazyjournal --command-color, -c Coloring in command line mode
|
||||
lazyjournal --command-fuzzy, -f Filtering using fuzzy search in command line mode
|
||||
lazyjournal --command-regex, -r Filtering using regular expression (regexp) in command line mode
|
||||
```
|
||||
|
||||
Access to all system logs and containers may require elevated privileges for the current user.
|
||||
|
||||
If your system uses [rsyslog](https://www.rsyslog.com) to collect logs from remote systems, you will be able to search for logs and analyze them from a single interface.
|
||||
Access to all system logs and containers may require elevated privileges for the current user. For example, if a user does not have permission to access the `/var/lib/docker/containers` directory, they will not be able to access history data from the time the container was started, but only from the time the containerization system was started, so the process of reading logs is different.
|
||||
|
||||
Information in the subtitle of the `Logs` window:
|
||||
|
||||
@@ -200,13 +218,42 @@ Information in the subtitle of the `Logs` window:
|
||||
- `interval` - auto-update interval for output in seconds (file logs are updated only when there are changes).
|
||||
- `color` - whether the output coloring mode is currently enabled or disabled.
|
||||
|
||||
Also output coloring is supported in command line mode:
|
||||
### Command-line mode
|
||||
|
||||
Coloring and filtering of output is supported in command-line mode:
|
||||
|
||||
```shell
|
||||
alias lj=lazyjournal
|
||||
alias lj=lazyjournal # >> $HOME/.bashrc
|
||||
|
||||
# Coloring the output from stdin
|
||||
cat /var/log/syslog | lj -c
|
||||
|
||||
# Filtering output in fuzzy search and regular expression mode
|
||||
cat /var/log/syslog | lj -f "error"
|
||||
cat /var/log/syslog | lj -r "failed|fatal|crash"
|
||||
```
|
||||
|
||||
### Hotkeys
|
||||
|
||||
- `F1` - show help on hotkeys.
|
||||
- `Tab` - switch between windows.
|
||||
- `Shift+Tab` - return to previous window.
|
||||
- `Enter` - selection a journal from the list to display log output.
|
||||
- `Left/Right` - switch between journal lists in the selected window.
|
||||
- `<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 every `10` or `100` lines (`500` for log output).
|
||||
- `<Shift/Ctrl>+<U/D>` - quickly move up and down (alternative for macOS).
|
||||
- `Ctrl+A` or `Home` - go to top of log.
|
||||
- `Ctrl+E` or `End` - go to the end of the log.
|
||||
- `Alt+Left/Right` - change the number of log lines to output (default: `50000`, range: `200-200000`).
|
||||
- `Shift+Left/Right` - change the auto refresh interval of the log output (default: `5`, range: `2-10`).
|
||||
- `Ctrl+T` - enable or disable timestamp for Docker logs.
|
||||
- `Ctrl+Q` - enable or disable built-in output coloring.
|
||||
- `Ctrl+S` - enable or disable coloring via [tailspin](https://github.com/bensadeh/tailspin).
|
||||
- `Ctrl+R` - update all log lists.
|
||||
- `Ctrl+W` - clear text input field for filter to quickly update current log output.
|
||||
- `Ctrl+C` - exit.
|
||||
|
||||
## Build
|
||||
|
||||
Clone the repository and run the project:
|
||||
@@ -236,34 +283,16 @@ make lint
|
||||
Unit tests cover all main functions and interface operation.
|
||||
|
||||
```shell
|
||||
make list # get a list of all tests
|
||||
make test n=TestMockInterface # run the selected test
|
||||
# Get a list of all tests
|
||||
make list
|
||||
# Run the selected test
|
||||
make test n=TestMockInterface
|
||||
```
|
||||
|
||||
The test coverage report using CI Actions for Linux, macOS and Windows systems is available on the [Wiki](https://github.com/Lifailon/lazyjournal/wiki) page.
|
||||
|
||||
Testing in BSD-based systems is done in a home environment using [usup](https://github.com/Lifailon/usup).
|
||||
|
||||
## Hotkeys
|
||||
|
||||
- `F1` - show help on hotkeys.
|
||||
- `Tab` - switch between windows.
|
||||
- `Shift+Tab` - return to previous window.
|
||||
- `Enter` - selection a journal from the list to display log output.
|
||||
- `Left/Right` - switch between journal lists in the selected window.
|
||||
- `<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 every `10` or `100` lines (`500` for log output).
|
||||
- `<Shift/Ctrl>+<U/D>` - quickly move up and down (alternative for macOS).
|
||||
- `Ctrl+A` or `Home` - go to top of log.
|
||||
- `Ctrl+E` or `End` - go to the end of the log.
|
||||
- `Alt+Left/Right` - change the number of log lines to output (default: `100000`, range: `5000-200000`).
|
||||
- `Shift+Left/Right` - change the auto refresh interval of the log output (default: `5`, range: `2-10`).
|
||||
- `Ctrl+Q` - enable or disable built-in output coloring.
|
||||
- `Ctrl+S` - enable or disable coloring via [tailspin](https://github.com/bensadeh/tailspin).
|
||||
- `Ctrl+R` - update all log lists.
|
||||
- `Ctrl+W` - clear text input field for filter to quickly update current log output.
|
||||
- `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](https://github.com/Lifailon/lazyjournal/issues) first.
|
||||
|
||||
Reference in New Issue
Block a user