On 05/10/2007 12:54 PM, oryann9 wrote:
[...]
The strings I need out of this are:

msgagt=ESM_WMB_AIX

sec_id=Sec_id

severity=Low

msgnode=qwmbap01.cardinalhealth.net

utc={2007-04-26 18:01:59.472+00:00}

om={

UID=3a7affd6-f420-11db-80b1-000000000000

AlertCode=AEM001

AlertType=AEM-default

AppName=AEM-CommonService2

Message=5004:An error has been reported by the
BIPXML4C component.:XML

}

[...]

You could try it this way:

#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;

my $data = do { local $/; <DATA> };

my $regex = '
    ((?:msgagt|sec_id|severity|msgnode)=[\w.]+)
    |
    ((?:utc|om)={[^}]+})
';

my @gotten = grep defined, $data =~ m/$regex/gx;
@gotten = map {
    s/{([^}]+)}/
        my $value = $1;
        $value =~ s{\s+}{}g;
        $value =~ s{,}{\n}g;
        $value;
    /e;
    $_;
} @gotten;
print Dumper([EMAIL PROTECTED]);


__DATA__
Node:          dudbqa02 Message group: MoM_OpC_ADM-m-s
Application:   OGTP Object:        syslog Severity:
  Critical Text:          WebSph

ere Broker v6003[2998366]:
(QWMB01.EG500)[8225]BIP2951I: Event generated by user
code. Additional information :
'msgagt=ESM_WMB_AIX,sec_id=Sec

_id,severity=Low,msgnode=qwmbap01.cardinalhealth.net,utc={2007-04-26
18:01:59.472+00:00},om={UID=3a7affd6-f420-11db-80b1-000000000000,AlertCod

e=AEM001,AlertType=AEM-default,AppName=AEM-CommonService2,Message=5004:An
error has been reported by the BIPXML4C
component.:XML}' 'MS_Alert_E

SM_Integrator.InsertToSYSLOG' '{2}' '{3}' '{4}' '{5}'
'{6}' '{7}' '{8}' '{9}' :
QWMB01.1aef50ec-1001-0000-0080-dae5df22a0ad:
/build/S600_P/src

/DataFlowEngine/ImbRdl/ImbRdlThrowExceptionStatements.cpp:
158: SqlThrowExceptionStatement::execute:
ComIbmComputeNode: MS_Alert_ESM_Integrato

r#FCMComposite_1_2,cma={Location=Not_found,BusUnit=Not_found}

__HTH__


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


Reply via email to