<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Find the diff between two times in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Find-the-diff-between-two-times/m-p/534992#M151198</link>
    <description>&lt;P&gt;First, we need to extract the fields.&amp;nbsp; Then we convert the timestamps into epoch form.&amp;nbsp; Finally, we can compute the difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your search&amp;gt;
| rex "51=(?&amp;lt;ts51&amp;gt;\d{8}-\d\d:\d\d:\d\d\.\d{3})"
| rex "59=(?&amp;lt;ts59&amp;gt;\d{8}-\d\d:\d\d:\d\d\.\d{3})"
| eval epoch51=strptime(ts51,"%Y%m%d-%H:%M:%S.%3N"), epoch59=strptime(ts59,"%Y%m%d-%H:%M:%S.%3N")
| eval diff=epoch59 - epoch51&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jan 2021 13:41:11 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2021-01-07T13:41:11Z</dc:date>
    <item>
      <title>Find the diff between two times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-the-diff-between-two-times/m-p/534983#M151196</link>
      <description>&lt;P&gt;Hi I am really struggling to find the difference between the 51= time and the 59= time below and add to a separate column&lt;/P&gt;&lt;P&gt;My log extract example is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;2021-01-06&lt;/SPAN&gt; &lt;SPAN class="t"&gt;12:37:57.411&lt;/SPAN&gt;&lt;SPAN&gt; [FIDO1&lt;/SPAN&gt;&lt;SPAN&gt;] &lt;/SPAN&gt;&lt;SPAN class="t"&gt;INFO&lt;/SPAN&gt; &lt;SPAN class="t"&gt;LogAuditor&lt;/SPAN&gt; &lt;SPAN class="t"&gt;-&lt;/SPAN&gt;&lt;SPAN&gt; [FIDO2&lt;/SPAN&gt;&lt;SPAN&gt;] &lt;/SPAN&gt;&lt;SPAN class="t"&gt;Outgoing&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN class="t"&gt;12294&lt;/SPAN&gt;&lt;SPAN&gt;][&lt;/SPAN&gt;&lt;SPAN class="t"&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;] &lt;/SPAN&gt;&lt;SPAN class="t"&gt;:&lt;/SPAN&gt; &lt;SPAN class="t"&gt;8=FIX.4.4&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;9=541&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;35=D&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;49=FIDO1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;56=FIDO2_192_168_0_1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;34=15992&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class="t"&gt;51=20210106-17:37:57.410&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;11=1609686062170-FIDO15140WTZ000878&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;15=USD&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;21=1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;38=1000000&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;40=2&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;44=19.6321&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;54=2&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;55=PECEOF&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;59=3&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#1;&lt;STRONG&gt;59&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class="t"&gt;=20210106-17:37:57.409&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance experts&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 20:29:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-the-diff-between-two-times/m-p/534983#M151196</guid>
      <dc:creator>luckyman80</dc:creator>
      <dc:date>2021-01-06T20:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Find the diff between two times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-the-diff-between-two-times/m-p/534992#M151198</link>
      <description>&lt;P&gt;First, we need to extract the fields.&amp;nbsp; Then we convert the timestamps into epoch form.&amp;nbsp; Finally, we can compute the difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your search&amp;gt;
| rex "51=(?&amp;lt;ts51&amp;gt;\d{8}-\d\d:\d\d:\d\d\.\d{3})"
| rex "59=(?&amp;lt;ts59&amp;gt;\d{8}-\d\d:\d\d:\d\d\.\d{3})"
| eval epoch51=strptime(ts51,"%Y%m%d-%H:%M:%S.%3N"), epoch59=strptime(ts59,"%Y%m%d-%H:%M:%S.%3N")
| eval diff=epoch59 - epoch51&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 13:41:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-the-diff-between-two-times/m-p/534992#M151198</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-01-07T13:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Find the diff between two times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-the-diff-between-two-times/m-p/535025#M151208</link>
      <description>&lt;P&gt;hi thanks for this. I still am unable to see the def in a separate column. Whats the best way of displaying the results for the diff ? in a table ?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 08:38:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-the-diff-between-two-times/m-p/535025#M151208</guid>
      <dc:creator>luckyman80</dc:creator>
      <dc:date>2021-01-07T08:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Find the diff between two times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-the-diff-between-two-times/m-p/535033#M151212</link>
      <description>&lt;P&gt;i actually noticed there is an issue with the strp time as there is no results given when i table the diff and epoch51/epoch59 items&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 10:43:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-the-diff-between-two-times/m-p/535033#M151212</guid>
      <dc:creator>luckyman80</dc:creator>
      <dc:date>2021-01-07T10:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Find the diff between two times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-the-diff-between-two-times/m-p/535042#M151217</link>
      <description>&lt;P&gt;Sorry about that.&amp;nbsp; &amp;nbsp;There were some typos in my answer.&amp;nbsp; I've fixed them.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 13:40:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-the-diff-between-two-times/m-p/535042#M151217</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-01-07T13:40:43Z</dc:date>
    </item>
  </channel>
</rss>

