Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

471.Count and statistics -- How to count the number of Unique IP address from a web log file?

User: editor -- 2010-04-08          << 470  472 >>
Hits: 2556
Type: Count and statistics   
Search all Count and statistics examples
Description:
How to count the number of Unique IP address from a web log file?
Input Sample:
171.81.208.129 - - [31/Mar/2010:05:21:55 -0700] "GET ... 
63.249.65.186 - - [31/Mar/2010:05:22:35 -0700] "GET ... 
107.46.204.179 - - [31/Mar/2010:05:24:18 -0700] "GET ... 
61.55.207.120 - - [31/Mar/2010:05:24:40 -0700] "GET ... 
107.46.204.179 - - [31/Mar/2010:05:25:17 -0700] "GET ... 
122.125.66.40 - - [31/Mar/2010:05:27:38 -0700] "GET ... 
122.125.66.109 - - [31/Mar/2010:05:27:42 -0700] "GET ... 
210.136.28.167 - - [31/Mar/2010:05:32:16 -0700] "GET ...
Output Sample:
unique IP number is 7
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source text file(log file) 
2. ctrl-h open replace window 
* set 'Replace Unit' to 'Line' 
* click 'Advanced' page 
set "Run following at the beginning of replace" to: 
 
set "Run following for each matched unit" to: 
 
set "insert end text" to: 
 
3. click 'Replace', done! 
Download Script:  scripts/471.rst.zip

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to count the number of records for each month in a web log file? (71%)
How to count the number of ip addresses from each country? (66%)
How to count the number of words for many files and append result to each file? (65%)
How to count number of words appeared in a text file? (65%)
How to sort all lines of ip addresses in a text file? (62%)
How to count number of digits(0-9) in a text file? (62%)
How to count how many IP addresses with different classes from web logs? (60%)
How to extract all IP address from a text file? (60%)

Check Demo of Count and statistics
Keywords:
count the number of unique ip ad  count the number of unique ip address  unique ip  toc  unique  pages  insert end text  insert end  ip address  statistics  count number for statistics  insert beginning  insert text at beginning  beginning end  insert end of file  replace text number count  insert text from file  insert text end text