Analyze access logs (Apache, nginx , load balancers) for quick troubleshoot
Download the most recent release binaries for your OS from https://github.com/cloudsark/loganalyzer/releases
Install each binary as follows,
- Move binary to '/usr/local/bin'
$ sudo mv loganalyzer /usr/local/bin
- Verify the binary file is working
$ loganalyzer --help
Access log analyzer can be used to analyze web servers , load balancers access logs
Usage:
loganalyzer [flags]
loganalyzer [command]
Available Commands:
bandwidth Print total bandwidth
custom Search for a custom field
help Help about any command
top Print top 10 IPs, Requests , etc
Flags:
-f, --file string access log filename
-h, --help help for loganalyzer
-v, --version version for loganalyzer
Use "loganalyzer [command] --help" for more information about a command.
- Get help
$ loganalyzer top --help
Get useful information about your web server, top command is used to print top 10 IPs, methods, requests and status codes
Usage:
loganalyzer top [command]
Available Commands:
ip Print Top 10 IP addresses accessing your web server
ip2loc Print Top 10 IP addresses accessing your web server with their location
method Print Top 10 HTTP methods used
request Print Top 10 requests
status Print Top 10 status codes
Flags:
-h, --help help for top
Global Flags:
-f, --file string access log filename
Use "loganalyzer top [command] --help" for more information about a command.
- Print Top 10 IP addresses accessing your web server
$ loganalyzer -f access.log top ip
- Print Top 10 IP addresses accessing your web server with their location
$ loganalyzer -f access.log top ip2loc
- Print Top 10 HTTP methods used
$ loganalyzer -f access.log top method
- Print Top 10 requests
$ loganalyzer -f access.log top request
- Print Top 10 status codes
$ loganalyzer -f access.log top status
- Print total bandwidth
$ loganalyzer -f access.log bandwidth
- Search for a custom field. Provide the regex for the field and loganalyzer will look for it
$ loganalyzer -f apache-daily-access.log custom --field-regex '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'