<?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 difference between two strftime fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculating-difference-between-two-strftime-fields/m-p/538331#M152162</link>
    <description>&lt;P&gt;Awesome, thank you!&lt;/P&gt;</description>
    <pubDate>Tue, 02 Feb 2021 19:30:17 GMT</pubDate>
    <dc:creator>jason_hotchkiss</dc:creator>
    <dc:date>2021-02-02T19:30:17Z</dc:date>
    <item>
      <title>Calculating difference between two strftime fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-difference-between-two-strftime-fields/m-p/538320#M152156</link>
      <description>&lt;P&gt;Hello Splunkers:&lt;BR /&gt;&lt;BR /&gt;I'm looking to determine how many days file is out of date.&lt;BR /&gt;&lt;BR /&gt;I have two strftime fields and values:&lt;BR /&gt;&lt;BR /&gt;x =&amp;nbsp;&lt;SPAN&gt;1612285190.000&lt;BR /&gt;&lt;/SPAN&gt;y =&amp;nbsp;&lt;SPAN&gt;1612303190.000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;I need to calculate the number of days between x and y, something like x - y = z.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I tried:&amp;nbsp;&lt;BR /&gt;| eval z=x-y&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;y calculates to -18000.00&lt;BR /&gt;&lt;BR /&gt;I tried converting this using:&lt;BR /&gt;| eval x=strftime(z, "d%") and I get 31.&amp;nbsp; Which seems to be the 31st day of the month.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 18:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-difference-between-two-strftime-fields/m-p/538320#M152156</guid>
      <dc:creator>jason_hotchkiss</dc:creator>
      <dc:date>2021-02-02T18:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating difference between two strftime fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-difference-between-two-strftime-fields/m-p/538324#M152158</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226579"&gt;@jason_hotchkiss&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You are very close, you can achieve this in two ways;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;This will give you days;
| eval z=round((x-y)/86400,0)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;This will give you timeformatted;
| eval z=tostring(x-y,"duration")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 18:53:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-difference-between-two-strftime-fields/m-p/538324#M152158</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-02-02T18:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating difference between two strftime fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-difference-between-two-strftime-fields/m-p/538331#M152162</link>
      <description>&lt;P&gt;Awesome, thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 19:30:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-difference-between-two-strftime-fields/m-p/538331#M152162</guid>
      <dc:creator>jason_hotchkiss</dc:creator>
      <dc:date>2021-02-02T19:30:17Z</dc:date>
    </item>
  </channel>
</rss>

