Nginx ip address with the highest traffic count

Source: Internet
Author: User

Command to count the maximum number of 100 ip addresses accessed in apache or nginx logs and the number of visits. This is often used in previous log statistics.

Awk '{print $1}' log address | sort | uniq-c | sort-n-k 1-r | head-n 100

The last column of the log is often used: Obtain the last column after splitting the awk Information

Linux, shell, awk, last column

Check the information and find it. Use $ NF in the last column. The example is as follows:

Cat $ (ll/home/sdzw/tcf/20151114_001/| awk '{print $ NF}') | grep "abc"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.