Robert Hicks am Dienstag, 10. Januar 2006 18.16:
> I have an application log that shows the "time", "id" and "type" for a user
> logging in. A short except looks like this:
>
> 19/12/2005 07:28:37  User (guest) logging in from (LIMS-CIT) - Assigned
> Userno (7045)
> 19/12/2005 07:32:06  User (guest) logging in from (LIMS-CIT) - Assigned
> Userno (1959)
> 19/12/2005 07:51:38  User (guest) logging in from (LIMS-CIT) - Assigned
> Userno (7601)
> 19/12/2005 07:54:10  User (guest) logging off - Userno (7601)
>
> I need to get the difference in the time from when 7601 logged into the
> system and logged out of the system. The caveat is that 7601 could log in
> and log out multiple times. I am having a hard time thinking about how to
> do that.
>
> Should I find the first login and look for the logout, get the diff and
> reset some counter. Do I use a hash for this?
>
> Just a little push (not off the cliff please)...is all I need.

Are you interested in one specific Userno only, or do you want the login times 
for all Usernos?

What do you mean by "could log in and log out multiple times"? In parallel, or 
sequential? If parallel: Are different Usernos assigned for the same user 
logged in multiple times?

A hash (or hash of hashes / hash of arrays) could be useful to lookup Usernos 
or login times.

Have you some code to post, f.e. the part extracting the wanted info from the 
lines?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to