Assignment 2

The file messages.1 is a log file from a Linux server.

Use techniques from Tcl Lab 2 (Files and I/O) and Tcl Lab 5: More Keyed Lists and procedures Call By Reference to examine this file and find out how many SSH attempts happened each hour of each day.

Use this keyedListLibByReference.tcl file for your work. In this version of the keyedList support library, the replaceValue function will add a key and value if they are not already in the keyed list.

You'll need to create a key that merges the time and day information.

Your application should create a report like this:


Day,Hour,SSH Attacks
20,05,60
20,08,2
20,09,2704
20,12,374
20,13,4577
20,14,441
20,20,232
20,22,1
21,04,1
21,11,1
22,00,21
22,01,424
22,02,44
22,09,23
22,15,3
22,17,1
22,20,3
22,23,175
23,00,302

This assignment can be solved using only global scope code and commands we've discussed in class or used in the previous labs. You do not need to use write any of your own procedures (but you may if you wish.)


Copyright Clif Flynt 2010