<?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 duration from a number in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculating-duration-from-a-number/m-p/683669#M233435</link>
    <description>&lt;P&gt;The "convert mktime()" could also be the way to go but you need to specify the time format with... the "timeformat=" option. Otherwise Splunk has to guess and usually guesses wrong.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2024 07:42:54 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-04-09T07:42:54Z</dc:date>
    <item>
      <title>Calculating duration from a number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-duration-from-a-number/m-p/683648#M233427</link>
      <description>&lt;P&gt;I am trying to find the duration for a time span. The "in" and "out" numbers are included in the data as type: number. I attempted:&lt;/P&gt;&lt;P&gt;in = 20240401183030&lt;/P&gt;&lt;P&gt;out = 20240401193030&lt;/P&gt;&lt;P&gt;| convert mktime(in) AS IN&lt;BR /&gt;| convert mktime(out) AS OUT&lt;BR /&gt;| eval Duration =OUT - IN&lt;/P&gt;&lt;P&gt;I have not been able to find a function that would directly convert number to time or if there is some multifunctional way to get the right duration between the two,&lt;/P&gt;&lt;P&gt;But this does not perform the correct time math.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 21:39:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-duration-from-a-number/m-p/683648#M233427</guid>
      <dc:creator>whipstash</dc:creator>
      <dc:date>2024-04-08T21:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating duration from a number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-duration-from-a-number/m-p/683649#M233428</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval IN = strptime(in, "%Y%m%d%H%M%S")
| eval OUT = strptime(out, "%Y%m%d%H%M%S")
| eval Duration = tostring(OUT - IN,"duration")&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 08 Apr 2024 22:13:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-duration-from-a-number/m-p/683649#M233428</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-08T22:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating duration from a number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-duration-from-a-number/m-p/683651#M233430</link>
      <description>&lt;P&gt;Thanks ITWhisperer! I did try the string conversion, but it did not work. This looks like it did the trick!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 22:28:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-duration-from-a-number/m-p/683651#M233430</guid>
      <dc:creator>whipstash</dc:creator>
      <dc:date>2024-04-08T22:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating duration from a number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-duration-from-a-number/m-p/683669#M233435</link>
      <description>&lt;P&gt;The "convert mktime()" could also be the way to go but you need to specify the time format with... the "timeformat=" option. Otherwise Splunk has to guess and usually guesses wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2024 07:42:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-duration-from-a-number/m-p/683669#M233435</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-04-09T07:42:54Z</dc:date>
    </item>
  </channel>
</rss>

