<?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: Calculating the duration in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582363#M202839</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49272"&gt;@joe06031990&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the Contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jan 2022 07:12:01 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-01-25T07:12:01Z</dc:date>
    <item>
      <title>Calculating the duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582264#M202811</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to calculate the duration of a call from the bellow search however it is appearing blank, the format is&amp;nbsp;&amp;nbsp;01/01/2015 13:26:29.64321574:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=test sourcetype=test&lt;BR /&gt;| eval created=strptime(starttime,"%Y-%m-%dT%H:%M:%S.%3N")&lt;BR /&gt;| eval last_time=strptime(endtime,"%Y-%m-%dT%H:%M:%S.%3N")&lt;BR /&gt;| eval diff=(last_time-created) | eval diff = round(diff/60/60/24)&lt;BR /&gt;| table diff&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 14:49:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582264#M202811</guid>
      <dc:creator>joe06031990</dc:creator>
      <dc:date>2022-01-24T14:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582265#M202812</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49272"&gt;@joe06031990&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You are using a wrong conversion format in strptime,&amp;nbsp;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test sourcetype=test
| eval created=strptime(starttime,"%d-%m-%Y %H:%M:%S.%8N")
| eval last_time=strptime(endtime,"%d-%m-%Y %H:%M:%S.%8N")
| eval diff=tostring(last_time-created,"duration")
| table diff&lt;/LI-CODE&gt;&lt;P&gt;Then, probably, it's better to use the tostring option to display duration.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 14:55:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582265#M202812</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-24T14:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582266#M202813</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;01/01/2015 13:26:29.64321574 is not conform&amp;nbsp;"%Y-%m-%dT%H:%M:%S.%3N" I assume&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 14:55:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582266#M202813</guid>
      <dc:creator>rrovers</dc:creator>
      <dc:date>2022-01-24T14:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582270#M202815</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just tried however it is still showing as blank for&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;created&lt;/P&gt;&lt;P&gt;last_time&lt;/P&gt;&lt;P&gt;diff&lt;/P&gt;&lt;P&gt;index=test sourcetype=test| eval created=strptime(starttime,"%d-%m-%Y %H:%M:%S.%8N")&lt;BR /&gt;| eval last_time=strptime(endtime,"%d-%m-%Y %H:%M:%S.%8N")&lt;BR /&gt;| eval diff=tostring(last_time-created,"duration")&lt;BR /&gt;| table diff&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 15:05:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582270#M202815</guid>
      <dc:creator>joe06031990</dc:creator>
      <dc:date>2022-01-24T15:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582274#M202818</link>
      <description>&lt;P&gt;I think you should use "/" instead of "-" between day,month,year.&lt;/P&gt;&lt;P&gt;Your example "&lt;SPAN&gt;&amp;nbsp;01/01/2015 13:26:29.64321574:" expects something like "%d/%m/%Y %H:%M:%S.%8N")&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 15:46:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582274#M202818</guid>
      <dc:creator>rrovers</dc:creator>
      <dc:date>2022-01-24T15:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582281#M202820</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49272"&gt;@joe06031990&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to use the same format of you time in the strptime function, if you have&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;02/01/2015 13:26:29.64321574&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;where 02 id day, 01 is month, 2015 is year, 13 is the hour, 26 is the minute, 29 is the second and&amp;nbsp;&lt;SPAN&gt;64321574 are 8 number after seconds,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;you have to use &lt;STRONG&gt;%d/%m/%Y %H:%M:%S.%8N&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In other words, you have to exactly use the same format, also in spaces and characters (as "/").&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 16:08:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582281#M202820</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-24T16:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582363#M202839</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49272"&gt;@joe06031990&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the Contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 07:12:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-the-duration/m-p/582363#M202839</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-25T07:12:01Z</dc:date>
    </item>
  </channel>
</rss>

