Skip to content

lianmafutra/Simple-Nginx-Log-Viewer-with-Go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

Simple Nginx Log Viewer From Local Path File

Go Reference License

Features

  • Web Dashboard
  • Filter By Range Date
  • Total Request
  • RPS (Request Per Second)
  • RPM (Request Per Minute)
  • Request URI/URL
  • Slow Response Time
  • Auto Generate CSV file
  • User Agent, HTTP Response Code , more ...

Requirements

  1. Default Regex = ^(\S+) - \[([^\]]+)\] "(\S+) (\S+) (\S+)" (\d+) (\d+) - "([^"]+)" - (\d+\.\d+)$

  2. Nginx Log = 119.235.212.226 - [18/Feb/2024:21:52:16 +0700] "GET / HTTP/2.0" 200 1644 - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0" - 0.058

  3. Nginx Server Config = log_format custom '$remote_addr - [$time_local] "$request" $status $body_bytes_sent - "$http_user_agent" - $upstream_response_time';

You can custom for your specific nginx log format

Usage

  1. Put nginx.log file in same directory main.go
  2. You Must edit Specific Range Date & Path File Nginx Log in main.go file
  3. Running file main.go with command go run main.go
  4. Open Web http://localhost:8080

Screenshoot

log

New Project (1)

New Project

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages