Counting device reboots

From: Mista_Blista (dcasselano_at_nyc.rr.com)
Date: 10/13/03


Date: Mon, 13 Oct 2003 11:12:32 GMT

Hello,

I know this must be amazingly easy but I am a perl amateur. I want to use
perl to analyze the log file info shown below, and count the number of times
each IP address appears. I also want it to show me the range of dates and
times of the first and last time the IP address appears in the log file.

Oct 6 17:15:38 172.16.21.101
Oct 7 14:49:17 172.16.21.101
Oct 7 17:35:22 172.16.21.101
Oct 3 15:26:57 172.16.21.102
Oct 5 11:28:24 172.16.21.102
Oct 5 14:09:52 172.16.21.102
Oct 5 23:34:39 172.16.21.102
Oct 6 00:26:09 172.16.21.102
Oct 7 04:11:32 172.16.21.102
Oct 3 00:03:58 172.16.21.103
Oct 3 22:45:57 172.16.21.103
Oct 4 12:55:10 172.16.21.103
Oct 4 13:34:11 172.16.21.103
Oct 5 02:20:49 172.16.21.103
Oct 6 03:46:05 172.16.21.103
Oct 6 13:22:40 172.16.21.103
Oct 6 13:43:14 172.16.21.103
Oct 6 15:24:55 172.16.21.103
Oct 6 16:17:43 172.16.21.103
Oct 8 00:35:24 172.16.21.103
Oct 2 16:43:13 172.16.21.104
Oct 2 21:29:22 172.16.21.104
Oct 3 15:17:24 172.16.21.104
Oct 4 00:12:18 172.16.21.104
Oct 6 00:42:07 172.16.21.104
Oct 6 14:10:25 172.16.21.104
Oct 6 16:25:00 172.16.21.104
Oct 6 16:32:35 172.16.21.104
Oct 6 17:51:06 172.16.21.104
Oct 6 18:09:04 172.16.21.104

The output would be similar to this below

Date Range Device # of Reboots
Oct.2 - Oct. 6 172.16.21.104 10



Relevant Pages

  • Re: Counting device reboots
    ... > I know this must be amazingly easy but I am a perl amateur. ... > times of the first and last time the IP address appears in the log file. ... The number of reboots is the number of elements of each array. ...
    (comp.lang.perl.misc)
  • Re: Counting device reboots
    ... > I know this must be amazingly easy but I am a perl amateur. ... > perl to analyze the log file info shown below, and count the number of times ... > times of the first and last time the IP address appears in the log file. ...
    (comp.lang.perl.misc)
  • Re: Latest Version not Correct
    ... If you've run analyze since this ... occurred, (and based on the log file, you have) I would restore the ... | Content-Type: text/plain; ... I use the Analyze Tool but didnt help. ...
    (microsoft.public.vstudio.sourcesafe)
  • ChainSaw v2 LogFilePatternReceiver doesnt work
    ... I just have downloaded the latest Version of ChanSaw from the homepage ... and want to analyze our log file. ... Could it be that Chainsaw is not able to handle logging output with ...
    (comp.lang.java.programmer)
  • Re: Reproduce previous stdout output without running previous command
    ... On June 8, 2009, Daniel Underwood wrote: ... save the output to a text file, so I can analyze the results outside ... session in a log file. ...
    (freebsd-questions)