User: editor -- 2010-07-27 << 573 575 >> |
Hits: 3418 |
Type: Count and statistics |
Search all Count and statistics examples |
Description: |
How to count how many IP addresses with different classes from web logs? How to make statistics of weblogs, find out how many class A IP addresses, as well as class B,C,D,E |
Input Sample: |
web log files: 12.13.14.15 .... 10.22.201.38 ... .... |
Output Sample: |
A 81378 B 5181 C 23929 |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
There are following classes of IP addresses: Class A 1.0.0.1 to 126.255.255.254 Class B 128.1.0.1 to 191.255.255.254 Class C 192.0.1.1 to 223.255.254.254 Class D 224.0.0.0 to 239.255.255.255 Class E 240.0.0.0 to 254.255.255.254 1. ctrl-o open source log file 2. ctrl-h open replace window * in search for pattern, enter: * uncheck option of "Print Unmatched Unit" # click "Advanced" page, * in "run following at the beginning of replace", enter: in "run following for each matched unit", enter: * in "insert end text", enter: 3. click "Replace", done! |
Download Script: scripts/574.rst.zip |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |