Robert Hicks:

> 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.

  perldoc -q nesting

  CPAN, search for 'parse'

Maybe adjust Parse::Syslog.

For the order, don't rely on the Date + Time but also store a
linenumber.

-- 
Affijn, Ruud

"Gewoon is een tijger."



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