<?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 PCs not scanned for more than 3 days in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/PCs-not-scanned-for-more-than-3-days/m-p/571605#M199180</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;This is my request:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=antivirus
    | stats values(SAVVersion) as SAVVersion, values(EngineVersion) as EngineVersion ,values(VirusDataVersion) as VirusDataVersion,  max(LastMessageTime) as LastMessageTime, max(LastScanDateTime) as LastScanDateTime by Name
    | sort LastScanDateTime
    | eval diff=round((Now() - LastScanDateTime)/60/60/24)
    | eval "active the last seven days ?"=if(round((Now() - LastMessageTime)/60/60/24)&amp;gt;7,"NO","YES")
    | where (diff &amp;gt; 3) OR isnull(diff)
    | fillnull value="-"
    | sort - "active the last seven days ?" - diff&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to have only the PCs(Name) not scanned (LastScanDateTime) for more than three days, but my request does not work, it returns all the PCs. Can you please help me?&lt;BR /&gt;sorry for my english&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Oct 2021 08:04:05 GMT</pubDate>
    <dc:creator>numeroinconnu12</dc:creator>
    <dc:date>2021-10-20T08:04:05Z</dc:date>
    <item>
      <title>PCs not scanned for more than 3 days</title>
      <link>https://community.splunk.com/t5/Splunk-Search/PCs-not-scanned-for-more-than-3-days/m-p/571605#M199180</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;This is my request:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=antivirus
    | stats values(SAVVersion) as SAVVersion, values(EngineVersion) as EngineVersion ,values(VirusDataVersion) as VirusDataVersion,  max(LastMessageTime) as LastMessageTime, max(LastScanDateTime) as LastScanDateTime by Name
    | sort LastScanDateTime
    | eval diff=round((Now() - LastScanDateTime)/60/60/24)
    | eval "active the last seven days ?"=if(round((Now() - LastMessageTime)/60/60/24)&amp;gt;7,"NO","YES")
    | where (diff &amp;gt; 3) OR isnull(diff)
    | fillnull value="-"
    | sort - "active the last seven days ?" - diff&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to have only the PCs(Name) not scanned (LastScanDateTime) for more than three days, but my request does not work, it returns all the PCs. Can you please help me?&lt;BR /&gt;sorry for my english&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 08:04:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/PCs-not-scanned-for-more-than-3-days/m-p/571605#M199180</guid>
      <dc:creator>numeroinconnu12</dc:creator>
      <dc:date>2021-10-20T08:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: PCs not scanned for more than 3 days</title>
      <link>https://community.splunk.com/t5/Splunk-Search/PCs-not-scanned-for-more-than-3-days/m-p/571607#M199181</link>
      <description>&lt;P&gt;Fistly - no point in sorting the data if you want to filter the entries anyway. It'd be more efficient to filter first, then sort - possibly less data to sort.&lt;/P&gt;&lt;P&gt;But to the point - is your LastScanDateTime properly set? Are you sure you don't need to strptime() it first, before doing a comparison to now()?&lt;/P&gt;&lt;P&gt;Oh, and round()-ing the difference will show you results which are more than 7.5 days behind, not 7. You don't need to do round() to just compare to a value and even if you wanted it to - for example - calculate a new field with number of days since last check, you'd rather use floor(), not round().&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 08:18:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/PCs-not-scanned-for-more-than-3-days/m-p/571607#M199181</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-10-20T08:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: PCs not scanned for more than 3 days</title>
      <link>https://community.splunk.com/t5/Splunk-Search/PCs-not-scanned-for-more-than-3-days/m-p/571608#M199182</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;my correction, it's work&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=antivirus
    | eval lmt=strptime(LastMessageTime,"%m/%d/%Y %H:%M:%S")
    | eval lst=strptime(LastScanDateTime,"%m/%d/%Y %H:%M:%S")
    | stats values(SAVVersion) as SAVVersion, values(EngineVersion) as EngineVersion ,values(VirusDataVersion) as VirusDataVersion,  max(lmt) as LastMessageTime, max(lst) as LastScanDateTime by Name
    | sort LastScanDateTime
    | eval diff=round((Now() - LastScanDateTime)/60/60/24)
    | eval "active in the last 7 days ?"=if(round((Now() - LastMessageTime)/60/60/24)&amp;gt;7,"NO","YES")
    | eval LastMessageTime=strftime(LastMessageTime,"%d/%m/%Y %H:%M:%S")
    | eval LastScanDateTime=strftime(LastScanDateTime,"%d/%m/%Y %H:%M:%S")
    | where (diff &amp;gt; 3) OR isnull(diff)
    | fillnull value="-"
    | sort - "active in the last 7 days?" - diff&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 20 Oct 2021 08:37:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/PCs-not-scanned-for-more-than-3-days/m-p/571608#M199182</guid>
      <dc:creator>numeroinconnu12</dc:creator>
      <dc:date>2021-10-20T08:37:37Z</dc:date>
    </item>
  </channel>
</rss>

