Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Given your posted input file:</p> <pre><code>$ cat file 2013-04-03 08:54:19,989 INFO [LOGGER] &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;event&gt;&lt;body&gt;&amp;amp;lt;UId&amp;amp;gt;904c-be-4e-bbda-3e62&amp;amp;lt;/UId&amp;amp;gt;&amp;amp;lt;&lt;/body&gt;&lt;/event&gt; 2013-04-03 08:54:39,389 INFO [LOGGER] &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;event&gt;&lt;body&gt;&amp;amp;lt;UId&amp;amp;gt;904c-be-4e-bbda-3e62&amp;amp;lt;/UId&amp;amp;gt;&amp;amp;lt;&lt;/body&gt;&lt;/event&gt; 2013-04-03 08:54:34,979 INFO [LOGGER] &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;event&gt;&lt;body&gt;&amp;amp;lt;UId&amp;amp;gt;edfc-fr-5e-bced-3443&amp;amp;lt;/UId&amp;amp;gt;&amp;amp;lt;&lt;/body&gt;&lt;/event&gt; 2013-04-03 08:55:19,569 INFO [LOGGER] &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;event&gt;&lt;body&gt;&amp;amp;lt;UId&amp;amp;gt;edfc-fr-5e-bced-3443&amp;amp;lt;/UId&amp;amp;gt;&amp;amp;lt;&lt;/body&gt;&lt;/event&gt; </code></pre> <p>This GNU awk script (you are using GNU awk since you set RS to a multi-character string in the script you posted in your question)</p> <pre><code>$ cat tst.awk { date = $1 time = $2 guid = gensub(/.*;gt;([^&amp;]+).*/,"\\1","") print guid, date, time } </code></pre> <p>will pull out what I THINK is the information you care about:</p> <pre><code>$ gawk -f tst.awk file 904c-be-4e-bbda-3e62 2013-04-03 08:54:19,989 904c-be-4e-bbda-3e62 2013-04-03 08:54:39,389 edfc-fr-5e-bced-3443 2013-04-03 08:54:34,979 edfc-fr-5e-bced-3443 2013-04-03 08:55:19,569 </code></pre> <p>The rest is simple math, right? And do it in this awk script - don't go piping the awk output to some goofy shell loop!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload