NAME GoogLog - CGI part (the research part) of GoogLog VERSION $Revision: 1.18 $ SYNOPSIS GoogLog is a easy and simple web tool to search inside your syslog files. If you want to search inside your syslog files from a web interface, this tool is made for you. Install it in the cgi-bin directory of your web server, and configure some variable below. The goal of Googlog is to be simple to install and use. so there's not a lot of functionnality, but, from my point of vue, it is simple to install and use and fast to search into syslog's files. DOWNLOAD Go here to download the latest version. DEMO Follow this link to see an online demo of GoogLog (on very few restrictedt syslog files): INSTALL PERL Modules Required PERL modules Config::Tiny Compress::Zlib HTML::Template Under debian and debian based distrib : apt-get install libhtml-template-perl libcompress-zlib-perl libconfig-tiny-perl SYSLOG server I recommend to use syslog-ng (actually google works only with syslog-ng) and to add this sort of generic config in the syslog-ng config file (on your syslog server of course). Modify to fit your needs but, keep in mind that the structure of the directory must always be like this : /LOGDIR/Category/YYYY-MM-DD/HH-name.log # log generique source net { udp(); }; destination d_generique { file("/var/log/net/$FACILITY/$YEAR-$MONTH-$DAY/$HOUR-$FACILITY.log" owner(root) group(adm) perm(0644) dir_perm(0755) create_dirs(yes) dir_group(adm)); }; log { source(net) ; destination(d_generique); }; GoogLog GoogLog consist of 3 files that need to be installed into the same directory into your cgi-bin directory (/usr/lib/cgi-bin/ on GNU/Debian): GoogLog_cgi.pl This file. this is the main program. It has to have the execution bits enabled to the user that run you web server (or the user you configured into the virtualhost if you use suexec) index.html The template file used to render the result. put it with the GoogLog_cgi.pl. googlog.ini Configuration file for GoogLog. you will put here where to find logfile to search in. see description below to know what to put in it. PARAMETERS CONFIG FILE Googlog use a config file (placed in the same directory of the Googlog CGI) that contains these attributes : general directives debug Active debug or not logdir Where are the logs Directive for categories Each specific categories start with [nameofcategories] and understand this specific attributes : subdir For wich subdir this category is for line_around How many lines do we search around the previous found pattern for related search. CGI This is what GoogLog_cgi.pl understand in a GET request. action action can be : list : list available categories to search (not used now) search : do the real search related : do the related search (it means try to use some related grep to find related line) date Format of date : YYYY-MM-DD hours Which hours pattern What we're looking for in log cat Which category host On which host do we need to do related search process On which process do we need to do related search (if not more pertinent) file Which file. used by related search HISTORY Extract from CVS commit : $Log: GoogLog_cgi.pl,v $ Revision 1.18 2006/12/21 13:42:14 jlb add some documentation Revision 1.17 2006/12/21 13:22:50 jlb replace date text field with a select field Revision 1.16 2006/12/08 16:26:58 jlb substitute ^I by
in syslog line, because some program syslog mutltiline with ^I instead of \n Revision 1.15 2006/12/08 15:30:09 jlb cosmetic update : - result are put in a table (to be well align) - nbsp replaced by space (to be able to have broken line) Revision 1.14 2006/12/07 16:20:47 jlb Do some documentation work Revision 1.13 2006/12/04 10:57:37 jlb use CVS version as the main versionning Revision 1.12 2006/12/01 16:01:22 jlb add some cosmetic features Revision 1.11 2006/12/01 14:38:50 jlb add escapeHTML function for some string that contains bad caracters Revision 1.10 2006/12/01 14:12:25 jlb Little bug fix on the default date presentation Revision 1.9 2006/11/30 17:08:38 jlb bug fix in the generation of file list Revision 1.8 2006/11/30 16:43:51 jlb - start using CSS - simplify template (only used index.html - add URL-click-search feature (can make search on every part of log found) Revision 1.7 2006/10/19 16:39:21 jlb start of cosmetic design Revision 1.6 2006/10/18 21:29:09 jlb bug fix when file is compressed and we want to see related lines Revision 1.5 2006/10/18 21:25:56 jlb starting the plugin support Revision 1.4 2006/10/16 16:19:30 jlb irelated link starting to work Revision 1.3 2006/10/15 20:16:06 jlb work on related lines Revision 1.2 2006/10/12 16:23:27 jlb little design starting the related link (TBC) Revision 1.1 2006/10/11 23:46:33 jlb first functionnal version TODO : return more lines from log files LICENCE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. AUTHOR Jean-Louis Bergamo copyright 2006-2007