GoogLog - CGI part (the research part) of GoogLog
$Revision: 1.18 $
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.
Go here http://www.googlog.org/download/ to download the latest version.
Follow this link to see an online demo of GoogLog (on very few restrictedt syslog files): http://www.googlog.org/demo/GoogLog_cgi.pl
Required PERL modules
Under debian and debian based distrib : apt-get install libhtml-template-perl libcompress-zlib-perl libconfig-tiny-perl
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 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 use a config file (placed in the same directory of the Googlog CGI) that contains these attributes :
Each specific categories start with [nameofcategories] and understand this specific attributes :
This is what GoogLog_cgi.pl understand in a GET request.
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 <br> 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
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.
Jean-Louis Bergamo <jlb@googlog.org> copyright 2006-2007