"Linux Gazette...making Linux just a little more fun!"


The Answer Guy


By James T. Dennis, [email protected]
Starshine Technical Services, http://www.starshine.org/


(?)Re Script

From Joe Wronkowski on 23 Oct 1998

Hi Jim,
I was just wondering if there was an easy way to grab the time/date Oct 6 21:57:33 from the same line the 153.37.55.** was taken from. If you are busy I understand.

Thanks
Joe Wronkowski

(!)The following awk expression will isolate the date and time from these example lines:
date="$1 $2"
time="$3"

(?)sample of log file:

Oct  6 21:50:19 rogueserver in.telnetd[197]: connect from 208.224.174.21
Oct  6 21:50:24 rogueserver telnetd[197]: ttloop:  peer died: Success 
Oct  6 21:55:29 rogueserver in.telnetd[211]: connect from 208.224.174.21
Oct  6 21:55:35 rogueserver telnetd[211]: ttloop:  peer died: Success 
Oct  6 21:57:33 rogueserver in.pop3d[215]: connect from 153.37.55.65
Oct  6 21:57:34 rogueserver in.pop3d[215]: Servicing request for rogue


Copyright © 1998, James T. Dennis
Published in Linux Gazette Issue 34 November 1998


[ Answer Guy Index ] apache current digi ether goodtimes intlX largedisk
maybe numlock quota recovery script serial session
sound tape testsuite w95ie w95ras w95virus xdm


[ Table Of Contents ] [ Front Page ] [ Previous Section ] [ Next Section ]