To find the top 10 visitors of your Magento shop, you can easily use the Nginx access logging tot get these statistics. With one command on the CLI, you will be able to get many insights on your access logging.

Our Nginx access logging are generated in the JSON format. This way we can easily parse them from scripts, without having to use a special Nginx logging parser.

To show the Nginx access logging in a more human readable format, we created a little command line tool called hypernode-parse-nginx-log

 Parsing Nginx logs

  • To get started: Go to the Nginx log directory

  • Get the top 10 of today per domain

  • Get the top 40 of yesterday

  • Get the top 100 of all logs present

  • Finding IP’s that do many POST requests

 Write the output to a file

To redirect the output of your one-liners to a file as well to your screen, you can use tee:

 

20