|The Network People Solutions for Hosting Providers|
Apache::Logmonster - log utility for merging, sorting, and processing web logs
This documentation refers to Apache::Logmonster version 3.00
logmonster.pl -i <interval> [-v] [-r] [-n] [-b N]
Interval is one of:
hour (last hour) day (yesterday) month (last month)
-v verbose - lots of status messages -n dry run - do everything except feed the logs into the processor -r report - last periods hit counts -b N back N days - use with -i day to process logs older than one day
To see what it will do without actually doing anything
/usr/local/sbin/logmonster -i day -v -n
5 1 * * * /usr/local/sbin/logmonster -i day
From cron with a report of activity:
5 1 * * * /usr/local/sbin/logmonster -i day -v
Logmonster is a tool to collect log files from one or many Apache web servers, split them based on the virtual host they were served for, sort the logs into cronological order, and finally pipe the sorted logs to the log file analyzer of choice (webalizer, http-analyze, AWstats, etc).
Log collection: I have a number of web sites that are mirrored on two or three web servers. The statistics I care about are agreggate. I want to know how much traffic a web site is getting across all the servers. To accomplish that, the logs must be collected from each server.
Sorting: Since most log processors require the log file entries to be in chronological order, simply concatenating them, or feeding them one after another does not work. Logmonster takes care of this by sorting all the log entries for each vhost into chronological order.
Processor Agnostic: If I want to switch from one log processor to another, it should be simple and painless. Logmonster takes care of all the dirty work to make the possible. Each domain can even have its own processor.
Run in verbose mode (-v) to see addition status and error messages. If you want more verbosity, you can increase the verbosity by appending another -v (-v -v). If that is not enough, run with (-v -v -v) for even more verbosity. If that is not enough is, the source with you be. ``Fear is the path to the dark side. Fear leads to anger. Anger leads to hate. Hate leads to suffering.'' Fear not, for the source is strong with you.
Also helpful when troubleshooting is the ability to skip cleanup (so logfiles do not have to be fetched anew) with the --noclean command line option.
Not perl builtins
Compress::Zlib Date::Parse (TimeDate) Params::Validate
Carp Cwd FileHandle File::Basename File::Copy
None known. Report problems to author. Patches are welcome.
Matt Simerson (email@example.com)
Gernot Hueber - sumitted the daily userlogs feature Lewis Bergman - funded authoring of several features Raymond Dijkxhoorn - suggested not sorting the files for one log host Earl Ruby - a better regexp for apache log date parsing
Add support for analog.
Add support for individual webalizer.conf file for each domain (this will likely not happen until someone submits a diff or pays me to do it as I don't use webalizer any longer).
Delete log files older than X days/month - super low priority, it's easy and low maintenance to manually delete a few months log files when I'm sure I don't need them any longer.
Do something with error logs (other than just compress)
If files to process are larger than 10MB, find a nicer way to sort them rather than reading them all into a hash. Now I create two hashes, one with data and one with dates. I sort the date hash, and using those sorted hash keys, output the data hash to a sorted file. This is necessary as wusage and http-analyze require logs to be fed in chronological order. Look at awstats logresolvemerge as a possibility.
Add config file setting for the location of awstats.pl
Copyright (c) 2003-2007, The Network People, Inc. (firstname.lastname@example.org) All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the The Network People, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS CLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Last modified on 6/4/05.