Get the App
SLTechnology News&Howtos  ›  Servers  › 

Nginx traffic statistics

Shulou Source: shulou.com Published: 2022-06-02 17:46:59 11月16日 Update

Nginx traffic statistics

1. Statistics of UV based on visiting IP

Awk'{print $1} 'access.log | sort | uniq-c | wc-l

two。 Statistics visit URL Statistics PV

Awk'{print $7} 'access.log | wc-l

3. Query the most frequently visited URL

Awk'{print $7} 'access.log | sort | uniq-c | sort-n-k 1-r | more

4. Query the most frequently visited IP

Awk'{print $1} 'access.log | sort | uniq-c | sort-n-k 1-r | more

5. View logs based on time period statistics

Cat access.log | sed-n'/ 14\ / Mar\ / 2015 Mar 21 Mar 14\ / Mar\ / 2015 Mar 22 p' | more

Tags: Statistics frequency query traffic log time time period Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Technology MariaDB MySQL OPPO Reno