[+] Readme

This commit is contained in:
2025-04-29 03:02:14 -04:00
parent 6a7ff0b019
commit d781b2498a
2 changed files with 47 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
# Nginx Log Viewer
Just a simple script to view nginx logs.
![](./img.png)
## Install
```bash
cargo install --git <this repo>
```
## Setup
You need to set up nginx to log in the following format:
```nginx configuration
http {
# ...
log_format main escape=json '{'
'"t":"$time_iso8601",'
'"m":"$request_method",'
'"p":"$server_protocol",'
'"s":$status,'
'"u":"$scheme://$host$request_uri",'
'"ip":"$remote_addr",'
'"ic":"$http_cf_connecting_ip",'
'"if":"$http_x_forwarded_for",'
'"ua":"$http_user_agent",'
'"sz":$body_bytes_sent,'
'"ut":"$upstream_response_time",'
'"rt":"$request_time",'
'"rf":"$http_referer"'
'}';
access_log /var/log/nginx-access-extra.log main;
# ...
}
```
## Usage
```bash
tail -f /var/log/nginx-access-extra.log | nginx-log-fmt
```
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 761 KiB