1 2Ulric Eriksson <ulric@siag.nu> 3 4This program is used in conjunction with Webalizer to get host names 5rather than IP addresses in the statistics. Preprocess the log 6files with webresolve to replace IP addresses with host names. 7The program reads from stdin and writes to stdout: 8 9 webresolve < access_log > access_log.resolved 10 11 12I wrote the program to process access log files from Apache before 13they are analyzed by Webalizer. Recent versions of Webalizer has 14semi-working resolution built in, but not on all platforms, including 15the one siag.nu runs on. 16 17Each line is one record consisting of whitespace-separated fields. 18If the first field starts with a digit, we assume that it is an 19IP address which we try to look up. The rest of the line is ignored. 20The result of the lookup is cached and the line written back with 21the first field replaced by the host name, if lookup was successful. 22 23This program is pretty slow. Thanks to the caching, repeated visits 24from the same address will only result in one lookup. Therefore 25large files will be processed proportionally faster than small ones. 26 27 28The load from this program is very light, because it spends most of 29its time waiting for the resolver. This also means that large files 30can take quite some time to process. The solution is to split the 31log file and run several resolution processes in parallel. This is 32done by the script splitwr: 33 34 splitwr logfile > logfile.resolved 35 webalizer logfile.resolved 36 rm logfile.resolved 37 38By default, splitwr runs 20 parallel resolution processes. The number 39can be changed by editing the script. 40 41 42See INSTALL for installation instructions. 43 44