M
Mista_Blista
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
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