<?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: How to find events that haven't happened in a given amount of time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640888#M222050</link>
    <description>&lt;P&gt;It depends whether you can find those hosts by expanding your time range. If you can, just find max(_time) by host and check if it falls within needed range. If you can't, you must have a static list of hosts to compare events in your index with. You can't find something if it's not there.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2023 18:05:57 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2023-04-20T18:05:57Z</dc:date>
    <item>
      <title>How to find events that haven't happened in a given amount of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640858#M222033</link>
      <description>&lt;P&gt;I'm looking over vulnerability scan data and have the _time field formatted as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval Last_Scanned = strftime(time, "%F")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I created a search to show hosts(events) that have not been scanned within two weeks of the current date?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 16:44:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640858#M222033</guid>
      <dc:creator>atebysandwich</dc:creator>
      <dc:date>2023-04-20T16:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to find events that haven't happened in a given amount of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640878#M222043</link>
      <description>&lt;P&gt;Grouping by host and then filtering using relative_time should work. This only leaves you the date and host though, so maybe you'll want to add some fields to the stats command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats max(_time) as Last_Scanned by host
| where Last_Scanned&amp;lt;relative_time(now(), "-2w")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 17:32:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640878#M222043</guid>
      <dc:creator>rut</dc:creator>
      <dc:date>2023-04-20T17:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to find events that haven't happened in a given amount of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640888#M222050</link>
      <description>&lt;P&gt;It depends whether you can find those hosts by expanding your time range. If you can, just find max(_time) by host and check if it falls within needed range. If you can't, you must have a static list of hosts to compare events in your index with. You can't find something if it's not there.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 18:05:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640888#M222050</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-04-20T18:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to find events that haven't happened in a given amount of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640894#M222053</link>
      <description>&lt;P&gt;I ad to do some tweaking to make some of it work. when I did&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats max(Last_Scanned) by IP&lt;/LI-CODE&gt;&lt;P&gt;I got all the IPs and their last scan time. However, when I did the second line, no results were found.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It should be noted that earlier in the search _time was specified as time&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 18:24:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640894#M222053</guid>
      <dc:creator>atebysandwich</dc:creator>
      <dc:date>2023-04-20T18:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to find events that haven't happened in a given amount of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640899#M222055</link>
      <description>&lt;P&gt;OK, so are you adding the lines on _time or your formatted time? In your original question you added the following line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Last_Scanned = strftime(time, "%F")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%F = Equivalent to&amp;nbsp;%Y-%m-%d (the ISO 8601 date format).&lt;/P&gt;&lt;P&gt;The command max and the comparison with relative_time are expecting a timestamp, not formatted time. So you can either use the original timestamp or use strptime to transform it back.&lt;/P&gt;&lt;P&gt;See the following docs for more information.&lt;/P&gt;&lt;P&gt;strptime:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/DateandTimeFunctions#strptime.28.26lt.3Bstr.26gt.3B.2C.26lt.3Bformat.26gt.3B.29" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/DateandTimeFunctions#strptime.28.26lt.3Bstr.26gt.3B.2C.26lt.3Bformat.26gt.3B.29&lt;/A&gt;&lt;/P&gt;&lt;P&gt;relative_time:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/DateandTimeFunctions#relative_time.28.26lt.3Btime.26gt.3B.2C.26lt.3Bspecifier.26gt.3B.29" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/DateandTimeFunctions#relative_time.28.26lt.3Btime.26gt.3B.2C.26lt.3Bspecifier.26gt.3B.29&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Formats:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.4/SearchReference/Commontimeformatvariables#Time_variables" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.4/SearchReference/Commontimeformatvariables#Time_variables&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 18:41:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640899#M222055</guid>
      <dc:creator>rut</dc:creator>
      <dc:date>2023-04-20T18:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to find events that haven't happened in a given amount of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640901#M222057</link>
      <description>&lt;P class="lia-align-left"&gt;You can't do max() on non-numerical field. When you did your strftime() you lost the ability to calculate/compare timestamps.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 18:53:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640901#M222057</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-04-20T18:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to find events that haven't happened in a given amount of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640902#M222058</link>
      <description>&lt;P&gt;I removed strftime and moved a lookup after the searches you mentioned and it worked.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 18:57:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-events-that-haven-t-happened-in-a-given-amount-of/m-p/640902#M222058</guid>
      <dc:creator>atebysandwich</dc:creator>
      <dc:date>2023-04-20T18:57:46Z</dc:date>
    </item>
  </channel>
</rss>

