First ... Back ... Next ... Last ... (Notes home)

Recent assignment: Log analyzer

  • The assignment
  • gbn's tricks:
    1. Ignore "still logged in" lines: we don't know when they logged out; don't know when the log was generated, so can't include their statistics
    2. Put each line into an array. Group the arrays by username (since we like to report by-user stats). Thus, the main datastructure is a hash (usernames) of arrays (log lines), or HoA from man perldsc
    3. Transform all times into minutes; translate months into month numbers (for sorting); skip unwanted fields.
    4. Start by looking at the required input/output, rather than from all possible things you might do with the logfile.
  • Here's gbn's simple solution
  • First ... Back ... Next ... Last ... (Notes home)

    UAF Computer Science
    Prof. Greg Newby