Depenging on how you use cache files you may or may not have to run Analog twice. If you do the non-recommended approach and process log files adding to your current cache file, then you can output a report at the same time. My Best Practices recommendations are to configure your system as follows:

  1. Each night download the log file and create a cache file for
     entries for that day only. Name the cache file to reflect the data
     (e.g. 2004-05-23.cache) so you can sort and organize them later.
     Do not create any report at this round (OUTPUT NONE;
     http://www.analog.cx/docs/output.html#outstyle). The configuration
     file for this step should contain any of the data-specific
     INCLUDE/EXCLUDE and ALIAS commands as these only apply to log file
     lines and data.
  2. Now run Analog and Report Magic for each round of reports you wish
     to build. If you are doing a "total" report, just use CACHFILE *
     as your input source. You will have no log file for this run
     (LOGFILE NONE). If you want to run a report for the current month
     you can use, e.g CACHEFILE 2004-05-*.cache to do so. In this case
     set the OUTFILE to the name of the file you wish to write.
  3. You will need two configuration files (or sets of command-line
     options in a script) to do this. It's a really good idea to use
     the default analog.cfg for the *common* settings (those that you
     will use in both runs) and then put log file processing and
     cachefile building commands in the first included file, and
     report-specific settings in the second. or example, your snippets
     below would be each of the included files (e.g. analog-cache.cfg
     and analog-report.cfg) and everything else (in common) would go in
     the default analog.cfg. Then you can use the command line to
     select the "mode" to run in:
                  analog +g/users/gwc/stats/analog/analog-cache.cfg
                  analog +g/users/gwc/stats/analog/analog-report.cfg
  4. When sending output to Report Magic you can use a pipe to have
     Analog stream directly into rmagic, but it's better (especially
     while debugging a new system) to write it to a file somewhere and
     have Report Magic read that in. It may impede performance slightly
     but you'll be happy if you are trying to debug any issues about
     the data communicated in the COMPUTER output format. Also, there
     is a slight possibility that Analog can crash, leaving the pipe
     open and Report Magic will hang waiting for the end of the file.
     I've only heard of this a few time and I think it was mainly on
     Mac OS X.

Hope that's helpful.


-- Jeremy Wadsack MCS, LLC



Greg Walz-Chojnacki wrote:

I run analog against a web log that's about 500 meg/day. I grab it to
a
local machine and overwrite it every night at midnight. Obviously,
caching is an attractive option. Sadly, I just don't get it.

I have analog and rmagic running, but am not sure how to operate with
the cache. Is is basically a matter of running analog twice, once to
create the cache, and once to generate a report from the cache? Is
there a command line option to use a second config file, in that case?

I'm running OSx 10.3. Here's a snippet from my /etc/analog.cfg:
LOGFILE /Pinetree/access_log.0 #logfile is grabbed via ftp and
overwritten at 12:30 a.m. each day
CACHEOUTFILE /Users/gwc/Sites/stats/analog/cache.dat
# CACHEFILE /Users/gwc/Sites/stats/analog/cache*.dat
#OUTFILE /Library/WebServer/Documents/Report.html
#OUTFILE /Users/gwc/sites/cgi-bin/analog/Report.html
OUTPUT COMPUTER
OUTFILE /Users/gwc/sites/stats/analog/report.dat

Here's a second config file I created:
# LOGFILE logfile.log
# LOGFILE /old/logs/access_log.*
#LOGFILE /Pinetree/access_log.0
#CACHEOUT /Users/gwc/Sites/stats/analog/cache%y%M%D.dat
CACHEFILE /Users/gwc/Sites/stats/analog/cache.dat
#OUTFILE /Library/WebServer/Documents/Report.html
#OUTFILE /Users/gwc/sites/cgi-bin/analog/Report.html
OUTPUT COMPUTER
OUTFILE /Users/gwc/sites/stats/analog/report.dat

Here's the command line I tried for a second run of analog:
   /usr/local/bin/analog -G +g/users/gwc/stats/analog/analog2.cfg

Doesn't work.

I've gone over docs/cache.html a dozen times or so, and I guess I'm
too
thick to get it.

Thanks for any help.

Greg



+------------------------------------------------------------------------ | TO UNSUBSCRIBE from this list: | http://lists.isite.net/listgate/analog-help/unsubscribe.html | | Digest version: http://lists.isite.net/listgate/analog-help-digest/ | Usenet version: news://news.gmane.org/gmane.comp.web.analog.general | List archives: http://www.analog.cx/docs/mailing.html#listarchives +------------------------------------------------------------------------

Reply via email to