<?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: Difference between two times in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498140#M141093</link>
    <description>&lt;P&gt;Many thanks for promptness. And how about if it is just date only? &lt;/P&gt;

&lt;P&gt;Time_Created: 12/20/19&lt;BR /&gt;
Time_Closed: 1/1/20&lt;/P&gt;

&lt;P&gt;To how many days it took.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 04:40:11 GMT</pubDate>
    <dc:creator>mbasharat</dc:creator>
    <dc:date>2020-09-30T04:40:11Z</dc:date>
    <item>
      <title>Difference between two times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498138#M141091</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have two fields in my report. Time_Created and Time_Closed. They are for time an incident ticket was created and then closed.&lt;/P&gt;

&lt;P&gt;Their format is:&lt;/P&gt;

&lt;P&gt;Time_Created: 12/20/19 11:30 &lt;BR /&gt;
Time_Closed: 1/1/20 16:50 &lt;/P&gt;

&lt;P&gt;I need to find the difference between both and result in an additional field e.g. Time_to_resolution. &lt;/P&gt;

&lt;P&gt;Basically, I need to see how long it took to resolve a ticket from its creation to closure.&lt;/P&gt;

&lt;P&gt;Thanks, in advance!!!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:40:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498138#M141091</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-09-30T04:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498139#M141092</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Check this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval Time_Created="12/31/19 11:30",Time_Closed="1/1/20 16:50" 
| eval temp = tostring(round(strptime(Time_Closed,"%m/%d/%y %H:%M") -strptime(Time_Created,"%m/%d/%y %H:%M"),0),"duration") 
| eval Time_to_resolution=replace(temp,"(\d*)\+*(\d+):(\d+):(\d+)","\1 days \2 hours \3 minutes \4 secs") |table Time_Created Time_Closed Time_to_resolution
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Mar 2020 05:42:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498139#M141092</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-03-20T05:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498140#M141093</link>
      <description>&lt;P&gt;Many thanks for promptness. And how about if it is just date only? &lt;/P&gt;

&lt;P&gt;Time_Created: 12/20/19&lt;BR /&gt;
Time_Closed: 1/1/20&lt;/P&gt;

&lt;P&gt;To how many days it took.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:40:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498140#M141093</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-09-30T04:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498141#M141094</link>
      <description>&lt;P&gt;Check this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
 | eval Time_Created="12/31/19",Time_Closed="1/1/20" 
 | eval temp = tostring(round(strptime(Time_Closed,"%m/%d/%y") -strptime(Time_Created,"%m/%d/%y"),0),"duration") 
 | eval Time_to_resolution=replace(temp,"(\d*)\+*(\d+):(\d+):(\d+)","\1 day(s)")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Mar 2020 06:43:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498141#M141094</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-03-20T06:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498142#M141095</link>
      <description>&lt;P&gt;This is awesome! TY!!! This triggered my curiosity for some additional chart for my use case. How about converting below to month? Either fields with or without time will work because I am using everything you have provided.&lt;/P&gt;

&lt;P&gt;Time_Created: 12/20/19 11:30 to MonthCreated=December&lt;/P&gt;

&lt;P&gt;Time_Closed: 1/1/20 16:50 to MonthClosed=January&lt;/P&gt;

&lt;P&gt;Case statement or whatever is best as you suggest?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 06:54:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498142#M141095</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-03-20T06:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498143#M141096</link>
      <description>&lt;P&gt;Check this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
 | eval Time_Created="12/31/19",Time_Closed="1/1/20" 
 | eval MonthCreated = strftime(strptime(Time_Created,"%m/%d/%y"),"%B"), MonthClosed=strftime(strptime(Time_Closed,"%m/%d/%y"),"%B")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Mar 2020 07:13:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498143#M141096</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-03-20T07:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498144#M141097</link>
      <description>&lt;P&gt;Awesome!!! THANK YOU!!!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 14:49:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Difference-between-two-times/m-p/498144#M141097</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-03-20T14:49:07Z</dc:date>
    </item>
  </channel>
</rss>

