Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Aug 1996 12:36:43 -0700
From:      "M.R.Murphy" <mrm@Mole.ORG>
To:        jc@netview.net
Cc:        questions@FreeBSD.org
Subject:   Re: discriminating system messages from multiple hosts
Message-ID:  <199608061936.MAA26847@meerkat.mole.org>

next in thread | raw e-mail | index | archive | help
> From owner-freebsd-questions@freefall.freebsd.org Tue Aug  6 12:05:26 1996
> Date: Tue, 6 Aug 1996 13:24:58 -0500 (EST)
> To: questions@FreeBSD.org
> From: John Clark <jc@netview.net>
> Subject: discriminating system messages from multiple hosts
>
> Hello,
>  
> I have just recently started logging messages from one server to another
> (using a line in /etc/syslog.conf).  The first thing that immediately
> strikes me is the need to log each server to its own set of log files.  Can
> someone tell me if this is possible, and how to do it?
>

Each server will have its messages identified by server in the single log
file. Use awk to extract the information by server from the log file.

This makes logfile rotation easier. It's not hard to do the awk.
As an example, for the following snippet of log file (/var/log/messages)

Aug  6 12:27:50 mouse syslog: UU.SCF	SUCCESSFUL meerkat R(0) 
Aug  6 12:27:50 mouse syslog: UU.SCS	mole 9999 
Aug  6 12:27:50 mouse syslog: UU.SCF	SUCCESSFUL mole R(0) 
Aug  6 12:27:50 mouse syslog: UU.SCE	end 
Aug  6 12:27:50 mouse syslog: UU.HRE	scheduling complete 
Aug  6 12:30:11 meerkat popper[26839]: Stats: kjm 0 0 0 0
Aug  6 19:30:44 mole /kernel: sio1: 45 more interrupt-level buffer overflows (total 757)
Aug  6 12:30:02 mouse syslog: CR.RHB	begin root.hh 
Aug  6 12:30:02 mouse syslog: CR.RST	time reset (2181230.01, 2181230.01) 
Aug  6 12:30:02 mouse syslog: CR.RHE	end root.hh 


awk '$4 == "meerkat" {print}' /var/log/messages will print

Aug  6 12:30:11 meerkat popper[26839]: Stats: kjm 0 0 0 0

Regards,
Mike
--
Mike Murphy  mrm@Mole.ORG  +1 619 598 5874
Better is the enemy of Good



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608061936.MAA26847>