<?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: Evaluate difference between 2 (string) dates in the same event. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-between-2-string-dates-in-the-same-event/m-p/693548#M235964</link>
    <description>&lt;P&gt;Outstanding. That worked perfectly. Thank you.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jul 2024 01:43:46 GMT</pubDate>
    <dc:creator>bjbrookz</dc:creator>
    <dc:date>2024-07-17T01:43:46Z</dc:date>
    <item>
      <title>Evaluate difference between 2 (string) dates in the same event.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-between-2-string-dates-in-the-same-event/m-p/693543#M235961</link>
      <description>&lt;P&gt;Hello, I'm struggling mightily with this one. I have two dates in the same event, both are strings.&amp;nbsp; Their format is below. I would like to evaluate the number of days between the firstSeen and lastSeen dates. I would also like to evaluate the number of days since firstSeen and when the search is performed. Any help would be much appreciated...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;firstSeen:&amp;nbsp;Aug 27, 2022 20:18:37 UTC&lt;/P&gt;&lt;P&gt;lastSeen:&amp;nbsp;Jun 23, 2024 06:17:25 UTC&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 01:07:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-between-2-string-dates-in-the-same-event/m-p/693543#M235961</guid>
      <dc:creator>bjbrookz</dc:creator>
      <dc:date>2024-07-17T01:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate difference between 2 (string) dates in the same event.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-between-2-string-dates-in-the-same-event/m-p/693545#M235963</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can do that with an eval command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval firstSeenTS = strptime(firstSeen, "%b %d, %Y %H:%M:%S %Z"),
lastSeenTS = strptime(lastSeen, "%b %d, %Y %H:%M:%S %Z"),
firstLastDiff = (lastSeenTS - firstSeenTS)/86400,
firstNowDiff = (now() - firstSeenTS)/86400&lt;/LI-CODE&gt;&lt;P&gt;If you want to round your days down to whole numbers you can use floor()&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 01:25:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-between-2-string-dates-in-the-same-event/m-p/693545#M235963</guid>
      <dc:creator>Tom_Lundie</dc:creator>
      <dc:date>2024-07-17T01:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate difference between 2 (string) dates in the same event.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-between-2-string-dates-in-the-same-event/m-p/693548#M235964</link>
      <description>&lt;P&gt;Outstanding. That worked perfectly. Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 01:43:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-between-2-string-dates-in-the-same-event/m-p/693548#M235964</guid>
      <dc:creator>bjbrookz</dc:creator>
      <dc:date>2024-07-17T01:43:46Z</dc:date>
    </item>
  </channel>
</rss>

