IP PV UV and corresponding statistics shell

Source: Internet
Author: User

IP independent IP in the specified time of the non-pass IP

Squid Statistics method

[Email protected] etc]# cut-d ""-f1/usr/local/squid/var/logs/access.log|sort|uniq|wc-l

2823


When you use awk

awk ' {print '} ' |sort|uniq test_8.5.2016

10.185.130.78--[04/aug/2016:23:59:29 +0800] "GET http://swcdn.apple.com/content/downloads/52/05/041-9986/ 25o8fo3gq5m75ylgi9h1vgf4b0r5fovzhr/041-9986.zh_tw.dist http/1.1 "53879 Tcp_miss:hier_direc


The above should be the difference between cut and awk


PV Page view, page roaming times

In squid each log is a page of PV, but this statistic is meaningless hmm (statistics so many sites total PV, what use, but can use grep crawl the same domain site statistics)

General statistics of all:

[[email protected] etc]# wc-l/usr/local/squid/var/logs/access.log|awk ' {print $} '

3874236


According to the non-pass domain name statistics

(implemented with a For loop)

[[email protected] etc]# for I in ' cut-d ""-f7 test_8.5.2016 |cut-d "/"-f3|sort|uniq ';d o echo "${i} is visited (Times )"; grep $i test_8.5.2016-c;d One

Cn180156 is visited (times)

1

Dungcoivb.googlepages.com is visited (times)

1

Lh-hn-505 is visited (times)

8

Swcdn.apple.com is visited (times)

4

Www.whatismyip.com is visited (times)

1

UV statistics not through the number of customer service end

Squid log information accounted for no relevant data, so do not study

IP PV UV and corresponding statistics shell

Related Article

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.