Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boreq/plum
Plum is a real-time web server access log analyser.
https://github.com/boreq/plum
Last synced: 12 days ago
JSON representation
Plum is a real-time web server access log analyser.
- Host: GitHub
- URL: https://github.com/boreq/plum
- Owner: boreq
- Created: 2019-03-03T23:34:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T06:19:22.000Z (over 1 year ago)
- Last Synced: 2024-10-13T12:21:11.907Z (27 days ago)
- Language: Go
- Homepage: https://stats.0x46.net/
- Size: 2.77 MB
- Stars: 25
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-repositories - boreq/plum - Plum is a real-time web server access log analyser. (Go)
README
# Plum
Plum is a real-time web server access log analyser. It allows the user to
access the statistics using a web dashboard.## Installation
Plum is written in Go which means that the Go tools can be used to install the
program using the following command:$ go get github.com/boreq/plum/cmd/plum
If you prefer to do this by hand clone the repository and execute the `make`
program:$ git clone https://github.com/boreq/plum
$ make
$ ls build
plum## Usage
Plum can track a single log file in order to produce live data as well as load
any number of past log files in order to present historical data points.A common scenario on a `logrotate` enabled server is following a single log
file in order to produce live data as well as loading any number of past log
files in order to present historical data points.$ ls
my.access.log
my.access.log.1.gz
my.access.log.2.gz
my.access.log.3.gz
my.access.log.4.gz
You can use the following command to generate a default config file:$ plum default_config > config.json
Based on that prepare a config which will load the current access log as well
as the older logs:$ cat config.json
{
"serveAddress": "127.0.0.1:8118",
"websites": [
{
"name": "example.com",
"follow": "/path/to/example.access.log",
"load": [
"/path/to/example.access.log.*"
],
"logFormat": "combined"
}
]
}
Execute the program:
$ plum run config.json
INFO starting listening source=server address=127.0.0.1:8118Navigate to http://127.0.0.0:8118 to see the results.
## Configuration
### `websites.logFormat`
Specifies the log format. A custom or a predefined format can be used.
#### Predefined formats
When using a predefined format simply pass its name as the argument of this
option.- `combined` - a default format used by NGINX
#### Custom formats
When using a custom format a number of elements can be used to construct it, check out [parser.go](https://github.com/boreq/plum/blob/master/parser/parser.go).