Hello poj,

Although the script works nicely I tested it with the complete log file and unfortunately it does not parse the file as I would expect the output to be.

Sample of output:

{ "[ 11] 25/2/2017-19:02:06.980 proces_name thanos-Rx" => [ "line2: data\n", "line3: data\n", "line4: data\n", "line5: data\n", "line6: data\n", "line7: data\n", "line8: data\n", "line9: data\n", "line10 data\n", "line11: data\n", "line12: data\n", "line13: data\n", "line14: data\n", "line15: data\n", "line16: data\n", "line17: data\n", "line18: data\n", "line19: data\n", "line 20 {\n", "line21 data\n", "line22 data\n", "line23 data\n", "line24: data\n", "line25: data\n", "line26 = {\n", "line27: data\n", "}\n", "line29 data = {\n", "line30: data\n", "}\n", "line32: data\n", "line33: data = {\n", "line34: data = {\n", "line35: data = {\n", "line36: data\n", "}\n", "line38: data\n", "line39: data = {\n", "line40: data\n", "}\n", "line42 =\t{\n", "line43: data\n", "line44: data\n", "line45: data\n", "line46: data\n", "line47: data\n", "line48: data\n", "line49: data\n", "line50: data\n", "line51: data\n", "line52: data\n", "line53: data\n", "", "line55: data = {\n", "line56: data = {\n", "line57: data\n", "line58: data\n", "line59: data\n", "line60 = {\n", "line61: data\n", "}\n", "line63: data\n", "}\n", "line65 = {\n", "line66 = {\n", "line67: data\n", "}\n", "line69: data\n", "line70: data\n", "}\n", "line72 = {\n", "line73: data\n", "line74: data\n", "line75: data\n", "line76: data\n", "line77: data\n", "line78: data\n", "line79: data\n", "line80: data\n", "line81: data\n", "line82: data\n", "", "line84: data = {\n", "line85: data\n", "line86: data\n", "line87: data\n", "line88: data\n", "line89: data\n", "line90: data\n", "line91: data\n", "line92: data\n", "line93: data\n", "line94: data\n", "line95: data\n", "}\n", "}\n", "line98: data\n", "line99: data\n", "line100: data\n", "}\n", "}\n", "}\n", "line104: data\n", "line105: data\n", "line106: data\n", "line107: data\n", "}\n", "}\n", "line110: data\n", "}", ], }

I need to work with the regex that I have at the beginning, this is the closest solution that I have got to my problem.

Update: Inserting  <readmore> </readmore> tags to minimize space consumed.

Thank you for your time and effort reading and replying to my question.

Seeking for Perl wisdom...on the process of learning...not there...yet!

In reply to Re^6: Parsing log file with regular-expression match nested brackets by thanos1983
in thread Parsing log file with regular-expression match nested brackets [RESOLVED] by thanos1983

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.