<?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 Compare timestamps in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Compare-timestamps/m-p/37462#M8372</link>
    <description>&lt;P&gt;Is it possible to compare two times and get the difference in seconds? I have a field I am extracting called rec_time that I would like to compare to the timestamp on the event. This will show us the delay of processing the message. Both timestamps are in 24H time ..:..:..&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 26 Aug 2010 09:49:58 GMT</pubDate>
    <dc:creator>ericrobinson</dc:creator>
    <dc:date>2010-08-26T09:49:58Z</dc:date>
    <item>
      <title>Compare timestamps</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-timestamps/m-p/37462#M8372</link>
      <description>&lt;P&gt;Is it possible to compare two times and get the difference in seconds? I have a field I am extracting called rec_time that I would like to compare to the timestamp on the event. This will show us the delay of processing the message. Both timestamps are in 24H time ..:..:..&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2010 09:49:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-timestamps/m-p/37462#M8372</guid>
      <dc:creator>ericrobinson</dc:creator>
      <dc:date>2010-08-26T09:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Compare timestamps</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-timestamps/m-p/37463#M8373</link>
      <description>&lt;P&gt;The timestamp of the event is already available in epoch seconds in the field called &lt;CODE&gt;_time&lt;/CODE&gt;. The next step is to convert &lt;CODE&gt;rec_time&lt;/CODE&gt; to an epoch seconds using the eval command and strptime. Let's assume that it's formatted as: &lt;CODE&gt;2010-08-25T19:55:01-0700&lt;/CODE&gt;. Your search would be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval diff = _time - strptime(rec_time, "%Y-%m-%dT%H:%M:%S%z")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Aug 2010 09:57:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-timestamps/m-p/37463#M8373</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2010-08-26T09:57:59Z</dc:date>
    </item>
  </channel>
</rss>

