<?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: How to calculate the difference between two time stamps in a single event? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-calculate-the-difference-between-two-time-stamps-in-a/m-p/178328#M35757</link>
    <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2015 20:56:53 GMT</pubDate>
    <dc:creator>ambujhbti</dc:creator>
    <dc:date>2015-07-10T20:56:53Z</dc:date>
    <item>
      <title>How to calculate the difference between two time stamps in a single event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-calculate-the-difference-between-two-time-stamps-in-a/m-p/178324#M35753</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;This is my first post. &lt;/P&gt;

&lt;P&gt;I am trying to calculate time diff between two fields in a single event. &lt;/P&gt;

&lt;P&gt;For example: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time_HTTP_Start: 06/25/2015 09:59:43:586
Time_HTTP_Sent: 06/25/2015 09:59:43:830
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My current search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="XXXXXX"   host="XXXXXX" |eval diff= strptime(Time_HTTP_Sent,"%m/%d/%Y %H:%M:%S:%3N")- strptime(Time_HTTP_Start,"%m/%d/%Y %H:%M:%S:%3N")|table diff
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I only get an empty result. Can somebody tell me what I am missing? I am sure its very easy for you guys! &lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2015 15:49:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-calculate-the-difference-between-two-time-stamps-in-a/m-p/178324#M35753</guid>
      <dc:creator>ambujhbti</dc:creator>
      <dc:date>2015-06-25T15:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the difference between two time stamps in a single event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-calculate-the-difference-between-two-time-stamps-in-a/m-p/178325#M35754</link>
      <description>&lt;P&gt;First, make sure your fields are extracted correctly:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="XXXXXX"   host="XXXXXX" | table _time Time_HTTP_Sent Time_HTTP_Start _raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Jun 2015 16:36:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-calculate-the-difference-between-two-time-stamps-in-a/m-p/178325#M35754</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-06-25T16:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the difference between two time stamps in a single event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-calculate-the-difference-between-two-time-stamps-in-a/m-p/178326#M35755</link>
      <description>&lt;P&gt;I would break it down a little more, just so I could see what is happening:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="XXXXXX"   host="XXXXXX" 
| eval sent= strptime(Time_HTTP_Sent,"%m/%d/%Y %H:%M:%S:%3N")
| eval start= strptime(Time_HTTP_Start,"%m/%d/%Y %H:%M:%S:%3N")
| eval diff= sent-start
| table Time_HTTP_Sent Time_HTTP_Start sent start diff
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jun 2015 06:17:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-calculate-the-difference-between-two-time-stamps-in-a/m-p/178326#M35755</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-06-26T06:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the difference between two time stamps in a single event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-calculate-the-difference-between-two-time-stamps-in-a/m-p/178327#M35756</link>
      <description>&lt;P&gt;Thank you. I have checked it and found that the data was not extracted.  Thank you again!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 20:56:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-calculate-the-difference-between-two-time-stamps-in-a/m-p/178327#M35756</guid>
      <dc:creator>ambujhbti</dc:creator>
      <dc:date>2015-07-10T20:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the difference between two time stamps in a single event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-calculate-the-difference-between-two-time-stamps-in-a/m-p/178328#M35757</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 20:56:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-calculate-the-difference-between-two-time-stamps-in-a/m-p/178328#M35757</guid>
      <dc:creator>ambujhbti</dc:creator>
      <dc:date>2015-07-10T20:56:53Z</dc:date>
    </item>
  </channel>
</rss>

