husker has asked for the wisdom of the Perl Monks concerning the following question:
etc...16:32:45 08/24/00 ms7 OUT MasterModeller user1@host1 16:32:48 08/24/00 ms7 OUT Drafting user2@host2 16:48:00 08/24/00 ms7 IN MasterModeller user1@host1
I was going to make a hash with keys of ProductName and user@host, and store a string consisting of the date and time for each OUT record, and then do some time-delta calculations when I saw the corresponding IN record by going back to the hash and retrieve the OUT time I stored. This worked fine until I realized that any given user on a host can check out the SAME product more than once ... i.e., they can have two Drafting licenses checked out simultaneously. My current hash would break, overwriting the first OUT time/date string with the second one.
I thought about just concatenating time+date+product+user@host into one string and pushing it on an array, and then scanning that array when I find an IN record and look for that same product+user@host. However, seems like thats going to involve a lot of serial scanning, pattern matching, and string decomposition.
Does anyone have a better suggestion? I can provide more details if required.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Data structure for log file processing
by nuance (Hermit) on Aug 24, 2000 at 20:12 UTC | |
by husker (Chaplain) on Aug 24, 2000 at 22:21 UTC | |
|
Re (tilly) 1: Data structure for log file processing
by tilly (Archbishop) on Aug 24, 2000 at 20:08 UTC | |
by merlyn (Sage) on Aug 24, 2000 at 20:39 UTC | |
by husker (Chaplain) on Aug 24, 2000 at 22:23 UTC |