Apache Log Helper
This is a shell script I wrote to help me with my web server logs.
Usage: alh [OPTION]... [PATTERN(S)] Apache Log Helper. View/search Apache log files. The log file is grepped for PATTERN(s) if specified. By default log files are looked for in /var/log/apache/. -a Use the alternate log file error.log. -A Use the alternate log file referer.log. -c Print only the number of lines matched. -d Print the command(s) that would execute. (Debug) -e Exclude local IP addresses. -E Use egrep in place of grep. -f <file> Obtain patterns from <file>. -F Use fgrep in place of grep. -h Print this help text and exit. -i Ignore case on all matches. -l <file> Use <file> in place of access.log. -n <lines> Output <lines> lines when using -t. -o Use previous version of log file. Eg. access.log.0 -p Send output to $PAGER or more. -t Send the output to tail. -x <filter> Filter the output with the inverted pattern <filter>. -X <file> Same as -x but obtain patterns from <file>.
To install ALH simply follow these steps:
Note: I have only tested alh on my Linux servers at work and minimally on my Mac OS 10.2.8 PowerBook. I have not encountered any problems. Since I use the getopt program to parse the command line arguments ALH will not work everywhere. getopt is not always available and there are different implementations when it is.