| | 64 | == Processing the logs == |
| | 65 | |
| | 66 | We don't want to keep IP addresses in the log files -- we want to remove them so the stats can be made public, and the perl script http://wiki.opennicproject.org/Tier2ConfigObfuscatingLogs looks like it will do the job: |
| | 67 | |
| | 68 | {{{ |
| | 69 | #! /usr/bin/perl |
| | 70 | # |
| | 71 | # blurAddys.pl - Obfuscate IP addresses in a file |
| | 72 | # |
| | 73 | # cat some.log | blurAddys.pl > some_blurred.log |
| | 74 | # |
| | 75 | ##################################################################### |
| | 76 | use strict; |
| | 77 | |
| | 78 | while(<STDIN>) |
| | 79 | { |
| | 80 | s/\d{1,3}(\.|-)\d{1,3}(\.|-)\d{1,3}(\.|-)\d{1,3}/XX$1XX$2XX$3XX/g; |
| | 81 | #s/([0-9A-Fa-f]{4}:[0-9A-Fa-f:]+:[0-9A-Fa-f]{1,4})([^:0-9A-Fa-f])/XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX$2/g; |
| | 82 | print $_; |
| | 83 | } |
| | 84 | }}} |
| | 85 | |
| | 86 | The regular expression for ipv6 addresses was matching the date so that has been commented out. |
| | 87 | |
| | 88 | So the above perl script was saved to {{{/usr/local/bin/blurAddys.pl}}} |
| | 89 | |
| | 90 | == Awstats install == |
| | 91 | |
| | 92 | Deb installed: |
| | 93 | |
| | 94 | {{{ |
| | 95 | aptitude search awstats |
| | 96 | |
| | 97 | The following NEW packages will be installed: |
| | 98 | awstats libnet-xwhois-perl{a} |
| | 99 | }}} |
| | 100 | |