on Wed, 03 Jul 2002 13:56:22 GMT, Anders Holm wrote:

> I'm banging my head in trying to get the logic behind doing this, so
> any pointers are appreciated..

(Don't do that, it hurts ;-)

> AlarmInd:At=1025647244084,Point=Adm.Monitor,Text=process stops due to
> client disconnected,Code=1,
> 
> So, here is an Alarm Indication, UTC time when occurred, where it
> occurred in the app., a text describing the problem, and an error
> code. Now, what I want to do is to output that a problem occurred,
> what it was, when, where, and how many times it reoccurred in this
> log file. I guess I'd need to index this based on the error code (for
> simplicities sake), sort on where it occurred, and add a counter into
> the equation. 

The following creates a hash of arrays of hashes. Maybe you could start 
from there?

    #! perl -w
    use strict;
    use Data::Dumper;

    my %alarms;

    while (<DATA>) {
        s/^AlarmInd://;
        my %params = /(.*?)=(.*?),/g;
        push @{$alarms{$params{Code}}}, {%params};
    }
    
    print Dumper(\%alarms); # show datastructure


-- 
felix

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to