Tips for Log File Analysis


What to monitor


Distributed Logging vs Centralized Loghost

Local Logging

Centralized Logging

Types of log monitoring


Syslog


syslogd
/etc/syslog.conf
/var/adm/*
/var/log/*

Simple Watcher (Swatch)

man swatch
swatch --help
swatch --version


Swatch Configuration file (.swatchrc)

#
# Swatch configuration file
#

watchfor   /invalid/
        echo
        throttle 30:00

watchfor  /[Ff]ailed/
        echo

watchfor /but got/
        echo

watchfor /[Ee]rror/
        echo

watchfor /Real domain name/
        echo
        throttle 30:00

watchfor /[Tt]imeout/
        echo


Using swatch to examine files

swatch --examine=/var/log/<logfile>

Command line script to examine multiple files:

for file in `ls cron*`
do
echo "Start examination of:  $file"
swatch --examine $file
echo " "
echo " "
done