Close but no cigar. Output is
KEY: msgagt VALUE: ESM_WMB_AIX KEY: _id VALUE: severity KEY: e VALUE: AEM001 KEY: SM_Integrator.InsertToSYSLOG Use of uninitialized value in print at parse_4_ovo.plx line 22, <$out> + line 7. VALUE: KEY: /DataFlowEngine/ImbRdl/ImbRdlThrowExceptionStatements.cpp: 158 +: SqlThrowExceptionStatement::execute: ComIbmComputeNode: MS_Alert_ES +M_Integrato Use of uninitialized value in print at parse_4_ovo.plx line 22, <$out> + line 9. VALUE: KEY: r#FCMComposite_1_2 Use of uninitialized value in print at parse_4_ovo.plx line 22, <$out> + line 11. VALUE:
for loop on hash output ########################
_id -- severity e -- AEM001 msgagt -- ESM_WMB_AIX
maybe something like this, but even this is not exactly what I need:
my $data = qq#'msgagt=ESM_WMB_AIX,sec_id=Sec_id,severity=Low,node=test,msgnode=qw +mbap01.cardinalhealth.net,utc={2007-04-26 18:01:59.472+00:00},om={UID=3a7affd6-f420-11db-80b1-000000000000,Alert +Code=AEM001,AlertType=AEM-default,AppName=AEM-CommonService2,Message= +5004:An error has been reported by the BIPXML4C component.:XML}' #; print "$_\n" for $data =~ /((?:\w+=\w+)|(?:\w+=\{.*?\}))/g;
__OUTPUT__
msgagt=ESM_WMB_AIX sec_id=Sec_id severity=Low node=test msgnode=qwmbap01 UID=3a7affd6 AlertCode=AEM001 AlertType=AEM AppName=AEM Message=5004

In reply to Re^2: key value pair or simply a regexp by mikejones
in thread key value pair or simply a regexp by mikejones

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.