Search Terms HTTPD Log Macro
=search_terms() is a script macro to report search terms in the HTTPD log file.
search_terms(site, s) init status =piktstatus level =piktlevel task "Report new search terms" input logfile "=httpd_logdir/access_log_(site)" filter "=httpd_cgibin_root/webstats.pl -f -(s) -sl | =httpd_cgibin_root/searchterms.pl | =sort | =uniq -c | =sort +0n" rule output mail $inlin
webstats.pl is a Perl script (not shown) to filter HTTPD log files and output certain types of information in various formats.
You might invoke the =search_terms() macro in your alarms.cfg for more than one website log file thusly:
/////////////////////////////////////////////////////////////////////////////// SearchTermsEMC =search_terms(emc, e) /////////////////////////////////////////////////////////////////////////////// SearchTermsPIKT =search_terms(pikt, p) ///////////////////////////////////////////////////////////////////////////////
Output from the SearchTermsEMC script might look like, for example:
INFO: SearchTermsEMC Report new search terms 1 early+music+chicago 1 robert+osterlund+early+music 1 portative+organ+kit 1 rameau s+gavotte+and+violin ...
And output from the SearchTermsPIKT script might look like, for example:
INFO: SearchTermsPIKT Report new search terms 1 +path+macros 1 define+undefine 1 elif+ ifdef+ elsedef+ endif 1 if+define 1 load+average +threshold 1 postfix access ...
For more examples, see Samples.