Try with ?'s like this:

#!/usr/bin/perl -l # http://perlmonks.org/?node_id=1186713 use strict; use warnings; $_ = do { local $/; <DATA> }; print "topic,start_time,Endtime"; print join ',', $3, $2, $4 while /\b(\d+)-SUCCESSFUL (?= (?:.*\n)*? \d+\ (\S+).*Started.*\b(\d+_\1_\d+_IN_0) (?:.*\n)*? \d+\ (\S+).*Done.*\b\3 )/gx; __DATA__ 0317 09:53:14.865+0000 {12772} INFO [pm-worker-exec slot-Task:id=8274 +,env=12772,type=11][c.s.w.t.f.s.PostExecutionStage ] Loaded {child r +unId vs completion type}: {8286-SUCCESSFUL}{8287-SUCCESSFUL}{8288-SUC +CESSFUL}{8289-SUCCESSFUL}{8290-SUCCESSFUL}{8291-SUCCESSFUL}{8292-SUCC +ESSFUL}{8293-SUCCESSFUL}{8294-SUCCESSFUL}{8295-SUCCESSFUL}{8296-SUCCE +SSFUL} 0317 09:54:12.498+0000 {12772} INFO [pm-worker-exec slot-Task:id=8273 +,env=12772,type=55][edProcessInputBatchKafkaProducer] Started produci +ng records on topic 12772_8286_20170317_IN_0 0317 09:54:13.428+0000 {12772} INFO [pm-worker-exec slot-Task:id=8273 +,env=12772,type=55][edProcessInputBatchKafkaProducer] Started produci +ng records on topic 12772_8287_20170317_IN_0 0317 09:55:13.027+0000 {12772} INFO [pm-worker-exec slot-Task:id=8273 +,env=12772,type=55][edProcessInputBatchKafkaProducer] Done with produ +cing records on topic 12772_8286_20170317_IN_0 0317 09:55:15.027+0000 {12772} INFO [pm-worker-exec slot-Task:id=8273 +,env=12772,type=55][edProcessInputBatchKafkaProducer] Done with produ +cing records on topic 12772_8287_20170317_IN_0

In reply to Re^7: Log Parsing by tybalt89
in thread Log Parsing by piyushmnnit06

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.