Skip to content

Nginx logs analyzer. It parses access.log and display stat info filtered by time intervals

License

Notifications You must be signed in to change notification settings

freematiq/nginx_analyzer

Repository files navigation

nginx analyzer

This application works with nginx logs. Two formats of incoming data are available:

  1. Default nginx access.log format
  2. log_format timed_combined '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent $request_time "$http_referer" "$http_user_agent" "$http_x_forwarded_for"'

Before starting be sure that your data in format 1 or 2!

To start parsing you can use command line. Choose folder with this application and use command bellow

php yii parse/parse <filename>

Also you can use browser interface for parsing. Choose section "Парсер логов". In this case you can take file from anywhere on your PC.

Be careful! Parsing through browser works fine only with small files. For good productivity parse your file through command line.

If you work with command line wait for message "Успешно загружено". If you work with browser wait for message "Файл добавлен в БД".

After successful parsing you can analyze uploaded data. Choose tab "График из файла", find the raw with file you want and press link in the last column. You will be automatically redirected to tab "Графики" with next parameters: minimum and maximum dates that is contained in file and step which counts as difference between maximum and minimum dates divided to 48 parts.

Be careful. Large time gaps could contain data from another files because there is no filtering by file, application uses only time gaps.

For your own selection you can use tab "Графики" directly. Choose time period you want and interval which actually is the step of fragmentation. Interval measures in seconds (60 means one minute, 120 means two minutes and so on). For example, if you choose period in one day you can split it by hours using 3600 as interval value.

Be careful! If you choose a 1 year period and set interval step as 1 hour you risk to not get results.

After successful choosing of period and step you can analyze your data on 5 charts and 2 tables.

Chart 1

This chart shows the number of requests and their average execution time at the time point. Use labels under chart for filtering.

Chart 2

This chart shows top 20 ip, from which there were the most queries ordered by the quantity of queries.

Chart 3

This chart shows the number of requests with a defined request code.

Chart 4

This chart shows top 20 url, which are most often processed.

Chart 5

This chart shows total time of execution of queries with url in seconds.

Table 1

This table shows request execution time in seconds. If maximum or minimum time of request reached more often than once in two last columns you can see latest of these time.

Table 2

This table shows number of request codes from url (all, except 200). If period of time contains only code 200 you will see concominant message.

About

Nginx logs analyzer. It parses access.log and display stat info filtered by time intervals

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published