2025-04-29 03:02:14 -04:00
2025-04-29 02:53:21 -04:00
2025-04-29 02:52:30 -04:00
2025-04-29 02:53:21 -04:00
2025-04-29 02:53:21 -04:00
2025-04-29 03:02:14 -04:00
2025-04-29 03:02:14 -04:00

Nginx Log Viewer

Just a simple script to view nginx logs.

Install

cargo install --git <this repo>

Setup

You need to set up nginx to log in the following format:

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

tail -f /var/log/nginx-access-extra.log | nginx-log-fmt
S
Description
Just a simple script to colorize and view nginx logs.
Readme 785 KiB
Languages
Rust 100%