<?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: Trying to get difference between _time and _indextime in secs format in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-get-difference-between-time-and-indextime-in-secs/m-p/256682#M76866</link>
    <description>&lt;P&gt;Ok got it thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 04 Dec 2015 14:01:42 GMT</pubDate>
    <dc:creator>vinay4444</dc:creator>
    <dc:date>2015-12-04T14:01:42Z</dc:date>
    <item>
      <title>Trying to get difference between _time and _indextime in secs format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-get-difference-between-time-and-indextime-in-secs/m-p/256678#M76862</link>
      <description>&lt;P&gt;Tried using below search, but can't get result. I get null values in diff:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;XXX| eval indextime=strftime(_indextime,"%Y-%m-%d %H:%M:%S")  |eval capturetime=strftime(_time,"%Y-%m-%d %H:%M:%S")  | eval diff= tostring(indextime - capturetime) | table indextime capturetime diff
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Am I missing something?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2015 11:42:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-get-difference-between-time-and-indextime-in-secs/m-p/256678#M76862</guid>
      <dc:creator>vinay4444</dc:creator>
      <dc:date>2015-12-04T11:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get difference between _time and _indextime in secs format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-get-difference-between-time-and-indextime-in-secs/m-p/256679#M76863</link>
      <description>&lt;P&gt;Just do the diff calculation on the actual epoch value, before your strftime evals. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;XXX| eval diff= _indextime - _time | eval indextime=strftime(_indextime,"%Y-%m-%d %H:%M:%S") |eval capturetime=strftime(_time,"%Y-%m-%d %H:%M:%S") |  | table indextime capturetime diff
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Dec 2015 12:19:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-get-difference-between-time-and-indextime-in-secs/m-p/256679#M76863</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2015-12-04T12:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get difference between _time and _indextime in secs format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-get-difference-between-time-and-indextime-in-secs/m-p/256680#M76864</link>
      <description>&lt;P&gt;i tried that but it does not give the difference  in min or secs &lt;BR /&gt;
e.g&lt;BR /&gt;
capturetime                     indextime                                         diff&lt;BR /&gt;
2015-12-04 07:33:44 2015-12-04 07:33:50                         6&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2015 12:36:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-get-difference-between-time-and-indextime-in-secs/m-p/256680#M76864</guid>
      <dc:creator>vinay4444</dc:creator>
      <dc:date>2015-12-04T12:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get difference between _time and _indextime in secs format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-get-difference-between-time-and-indextime-in-secs/m-p/256681#M76865</link>
      <description>&lt;P&gt;The diff field is in seconds. &lt;BR /&gt;
The _indextime and _time fields are in unix epoch time format,  the number of seconds since January 1970. When you subtract one from the other the result is a value expressed in seconds&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2015 12:54:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-get-difference-between-time-and-indextime-in-secs/m-p/256681#M76865</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2015-12-04T12:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get difference between _time and _indextime in secs format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-get-difference-between-time-and-indextime-in-secs/m-p/256682#M76866</link>
      <description>&lt;P&gt;Ok got it thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2015 14:01:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-get-difference-between-time-and-indextime-in-secs/m-p/256682#M76866</guid>
      <dc:creator>vinay4444</dc:creator>
      <dc:date>2015-12-04T14:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get difference between _time and _indextime in secs format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-get-difference-between-time-and-indextime-in-secs/m-p/256683#M76867</link>
      <description>&lt;P&gt;No problem mate. If that's working for you do you mind accepting the answer?&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2015 14:14:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-get-difference-between-time-and-indextime-in-secs/m-p/256683#M76867</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2015-12-04T14:14:07Z</dc:date>
    </item>
  </channel>
</rss>

