Not able to parse log file which contains xml format

Hello,

I am having below webshpere GC log file which is generated in *.log format. Different GC cycles and for every GC cycle start tag: "cycle-start" End Tage: "cycle-End"
Now i need to parse each cycle as single message and get few field values from each message. Not sure how to do this? Kindly let me know?

<cycle-start id="4" type="global" contextid="0" timestamp="2020-06-18T01:17:50.472" intervalms="8632.426" />
<gc-start id="5" type="global" contextid="4" timestamp="2020-06-18T01:17:50.472">
  <mem-info id="6" free="1839615472" total="2147483648" percent="85">
    <mem type="tenure" free="1839615472" total="2147483648" percent="85">
      <mem type="soa" free="1732241904" total="2040110080" percent="84" />
      <mem type="loa" free="107373568" total="107373568" percent="100" />
    </mem>
  </mem-info>
</gc-start>
<allocation-stats totalBytes="307578784" >
  <allocated-bytes non-tlh="11715088" tlh="295863696" />
  <largest-consumer threadName="Thread-20" threadId="00000000304F7100" bytes="111552848" />
</allocation-stats>
<gc-end id="10" type="global" contextid="4" durationms="101.685" usertimems="125.458" systemtimems="0.447" timestamp="2020-06-18T01:17:50.574" activeThreads="8">
  <mem-info id="11" free="2087504192" total="2147483648" percent="97">
    <mem type="tenure" free="2087504192" total="2147483648" percent="97" micro-fragmented="12447289">
      <mem type="soa" free="1980130624" total="2040110080" percent="97" />
      <mem type="loa" free="107373568" total="107373568" percent="100" />
    </mem>
    <pending-finalizers system="11890" default="0" reference="6032" classloader="0" />
  </mem-info>
</gc-end>
<cycle-end id="12" type="global" contextid="4" timestamp="2020-06-18T01:17:50.574" />

<cycle-start id="17" type="global" contextid="0" timestamp="2020-06-18T01:18:15.152" intervalms="24679.587" />
<gc-start id="18" type="global" contextid="17" timestamp="2020-06-18T01:18:15.153">
  <mem-info id="19" free="107373568" total="2147483648" percent="4">
    <mem type="tenure" free="107373568" total="2147483648" percent="4">
      <mem type="soa" free="0" total="2040110080" percent="0" />
      <mem type="loa" free="107373568" total="107373568" percent="100" />
    </mem>
  </mem-info>
</gc-start>
<allocation-stats totalBytes="1975417816" >
  <allocated-bytes non-tlh="124107768" tlh="1851310048" />
  <largest-consumer threadName="[STANDBY] ExecuteThread: &apos;3&apos; for queue: &apos;weblogic.kernel.Default (self-tuning)&apos;" threadId="000000003036EF00" bytes="1880004840" />
</allocation-stats>
<gc-op id="20" type="mark" timems="148.657" contextid="17" timestamp="2020-06-18T01:18:15.302">
  <trace-info objectcount="2811750" scancount="2198087" scanbytes="66297568" />
  <finalization candidates="23134" enqueued="20084" />
  <ownableSynchronizers candidates="2612" cleared="596" />
  <references type="soft" candidates="23509" cleared="0" enqueued="0" dynamicThreshold="31" maxThreshold="32" />
  <references type="weak" candidates="40865" cleared="26873" enqueued="26719" />
  <references type="phantom" candidates="56" cleared="30" enqueued="30" />
  <stringconstants candidates="42199" cleared="202"  />
</gc-op>
<gc-op id="21" type="classunload" timems="5.453" contextid="17" timestamp="2020-06-18T01:18:15.307">
  <classunload-info classloadercandidates="223" classloadersunloaded="7" classesunloaded="1" anonymousclassesunloaded="0" quiescems="0.000" setupms="4.378" scanms="1.049" postms="0.025" />
</gc-op>
<gc-op id="22" type="sweep" timems="97.820" contextid="17" timestamp="2020-06-18T01:18:15.405" />
<gc-end id="23" type="global" contextid="17" durationms="252.397" usertimems="237.225" systemtimems="2.104" timestamp="2020-06-18T01:18:15.405" activeThreads="8">
  <mem-info id="24" free="1353029816" total="2147483648" percent="63">
    <mem type="tenure" free="1353029816" total="2147483648" percent="63" micro-fragmented="7865486">
      <mem type="soa" free="1283237000" total="2040110080" percent="62" />
      <mem type="loa" free="69792816" total="107373568" percent="64" />
    </mem>
    <pending-finalizers system="20046" default="38" reference="26749" classloader="0" />
  </mem-info>
</gc-end>
<cycle-end id="25" type="global" contextid="17" timestamp="2020-06-18T01:18:15.408" />

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.