<?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 Basic question about scheduled search in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/Basic-question-about-scheduled-search/m-p/485650#M8368</link>
    <description>&lt;P&gt;hello&lt;/P&gt;

&lt;P&gt;In my dashboard, I use a scheduled search with a filter token because i have a dropdown list which allow me to do a filter by SITE&lt;BR /&gt;
But I need to execute the stats command after the loadjob because I need to pick up all the 10 events (head 10) for a specific site&lt;BR /&gt;
If I am doing the stats command directly in the savedsearch, I pick up all the 10 events (head 10) but for different sites&lt;BR /&gt;
Is there a solution to solve the problem directly in the saved search because if I am doing the stats command afer the loadjob, its not very useful to use a scheduled search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| loadjob savedsearch="admin:SA_Monitoring_sh:Performances - Compliance host" 
| search SITE=$tok_filtersite|s$ 
| stats values(SITE) as SITE, count by host flag
| where isnotnull(flag) 
| rename host as Hostname, flag_patch_version as "Patch level", SITE as Site
| fields - count 
| table Hostname Site "Patch level" 
| sort +"Patch level" 
| head 10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2019 10:37:40 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2019-11-15T10:37:40Z</dc:date>
    <item>
      <title>Basic question about scheduled search</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Basic-question-about-scheduled-search/m-p/485650#M8368</link>
      <description>&lt;P&gt;hello&lt;/P&gt;

&lt;P&gt;In my dashboard, I use a scheduled search with a filter token because i have a dropdown list which allow me to do a filter by SITE&lt;BR /&gt;
But I need to execute the stats command after the loadjob because I need to pick up all the 10 events (head 10) for a specific site&lt;BR /&gt;
If I am doing the stats command directly in the savedsearch, I pick up all the 10 events (head 10) but for different sites&lt;BR /&gt;
Is there a solution to solve the problem directly in the saved search because if I am doing the stats command afer the loadjob, its not very useful to use a scheduled search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| loadjob savedsearch="admin:SA_Monitoring_sh:Performances - Compliance host" 
| search SITE=$tok_filtersite|s$ 
| stats values(SITE) as SITE, count by host flag
| where isnotnull(flag) 
| rename host as Hostname, flag_patch_version as "Patch level", SITE as Site
| fields - count 
| table Hostname Site "Patch level" 
| sort +"Patch level" 
| head 10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 10:37:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Basic-question-about-scheduled-search/m-p/485650#M8368</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-11-15T10:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question about scheduled search</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Basic-question-about-scheduled-search/m-p/485651#M8369</link>
      <description>&lt;P&gt;You can change the saved search and remove the stats command from it. Other options would include create a new saved search with the same contents from the previous one and remove the stats and a third option is to use a macro with variables. The macro would filter the site. The macro can be pretty much the same as your saved search.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 12:48:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Basic-question-about-scheduled-search/m-p/485651#M8369</guid>
      <dc:creator>gfreitas</dc:creator>
      <dc:date>2019-11-15T12:48:14Z</dc:date>
    </item>
  </channel>
</rss>

