<?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 Use same query for all the panels with different search value for just one field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Use-same-query-for-all-the-panels-with-different-search-value/m-p/378468#M168059</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;Problem to solve:

we have say 500 servers. out of 500 servers some servers have older versions of software installed. Some  server are even missing the softwares. we are trying to list this in the report.

SoftwareName    Version   NoOfhostwithsoftwareinstalled      NoOfHostmissingSoftwares                Listofhosts_thataremissing_softwares
Software1               1.0             300                                                        10                                                          server1
software1               1.1              190                                                                                                                      server2
                                                                                                                                                                                    ......
                                                                                                                                                                                 server10


I am trying to achieve this with the base search / postprocess.
I am able to list first 4 columns. But Not able to list the servers missing package. 

&amp;lt;code&amp;gt;
My dashboard XML:

&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Installed Softwares List&amp;lt;/label&amp;gt;
  &amp;lt;search id="baseSearch"&amp;gt;
    &amp;lt;query&amp;gt;index=powershell  source="powershell://CCT-InstalledSoftware" sourcetype=CCT_Software host ="UE1*A01" 
    | dedup host, DisplayName, DisplayVersion&amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;-24h&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;search base="baseSearch"&amp;gt;
          &amp;lt;query&amp;gt; | stats dc(host) as TotalNoOfHosts values(host) as allhostlist&amp;lt;/query&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;condition&amp;gt;
              &amp;lt;set token="tokhost"&amp;gt;$result.TotalNoOfHosts$&amp;lt;/set&amp;gt;
              &amp;lt;set token="tokhostlist"&amp;gt;$result.allhostlist$&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
          &amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;search base="baseSearch"&amp;gt;
    &amp;lt;query&amp;gt;search DisplayName="software*"  | stats dc(host) as HostsWithPackage values(host) as packlist &amp;lt;/query&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;condition&amp;gt;
        &amp;lt;set token="tokpack"&amp;gt;$result.HostsWithPackage$&amp;lt;/set&amp;gt;
        &amp;lt;set token="tokpacklist"&amp;gt;$result.packlist$&amp;lt;/set&amp;gt;
      &amp;lt;/condition&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;List of Hosts with Package&amp;lt;/title&amp;gt;
        &amp;lt;search base="baseSearch"&amp;gt;
          &amp;lt;query&amp;gt;search DisplayName="software1*" | rex "DisplayVersion=(?&amp;lt;versionD1&amp;gt;\d+)" | rex "DisplayVersion=\d+.(?&amp;lt;versionD2&amp;gt;\d+)" | rex "DisplayVersion=\d+.\d+.(?&amp;lt;versionD3&amp;gt;\d+)" | rex "DisplayVersion=\d+.\d+.\d+.(?&amp;lt;versionD4&amp;gt;\d+)" | sort host -versionD1 -versionD2 -versionD3 -versionD4 | streamstats count by host | where count=1 | eval Version = versionD1.".".versionD2.".".versionD3.".".versionD4 | dedup host, DisplayName, DisplayVersion | dedup host, DisplayName, DisplayVersion | stats estdc(host) as HostsWithPackage by DisplayName DisplayVersion&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;Hosts_missing_packages&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults
 | eval Hosts_missing_packages=$tokhost$-$tokpack$ |table Hosts_missing_packages&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;@d&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Can someone suggest how do I pass the list values from both the searches to my final panel and find the missing list of servers. 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 28 Jul 2018 06:31:57 GMT</pubDate>
    <dc:creator>psmp</dc:creator>
    <dc:date>2018-07-28T06:31:57Z</dc:date>
    <item>
      <title>Use same query for all the panels with different search value for just one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-same-query-for-all-the-panels-with-different-search-value/m-p/378468#M168059</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Problem to solve:

we have say 500 servers. out of 500 servers some servers have older versions of software installed. Some  server are even missing the softwares. we are trying to list this in the report.

SoftwareName    Version   NoOfhostwithsoftwareinstalled      NoOfHostmissingSoftwares                Listofhosts_thataremissing_softwares
Software1               1.0             300                                                        10                                                          server1
software1               1.1              190                                                                                                                      server2
                                                                                                                                                                                    ......
                                                                                                                                                                                 server10


I am trying to achieve this with the base search / postprocess.
I am able to list first 4 columns. But Not able to list the servers missing package. 

&amp;lt;code&amp;gt;
My dashboard XML:

&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Installed Softwares List&amp;lt;/label&amp;gt;
  &amp;lt;search id="baseSearch"&amp;gt;
    &amp;lt;query&amp;gt;index=powershell  source="powershell://CCT-InstalledSoftware" sourcetype=CCT_Software host ="UE1*A01" 
    | dedup host, DisplayName, DisplayVersion&amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;-24h&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;search base="baseSearch"&amp;gt;
          &amp;lt;query&amp;gt; | stats dc(host) as TotalNoOfHosts values(host) as allhostlist&amp;lt;/query&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;condition&amp;gt;
              &amp;lt;set token="tokhost"&amp;gt;$result.TotalNoOfHosts$&amp;lt;/set&amp;gt;
              &amp;lt;set token="tokhostlist"&amp;gt;$result.allhostlist$&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
          &amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;search base="baseSearch"&amp;gt;
    &amp;lt;query&amp;gt;search DisplayName="software*"  | stats dc(host) as HostsWithPackage values(host) as packlist &amp;lt;/query&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;condition&amp;gt;
        &amp;lt;set token="tokpack"&amp;gt;$result.HostsWithPackage$&amp;lt;/set&amp;gt;
        &amp;lt;set token="tokpacklist"&amp;gt;$result.packlist$&amp;lt;/set&amp;gt;
      &amp;lt;/condition&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;List of Hosts with Package&amp;lt;/title&amp;gt;
        &amp;lt;search base="baseSearch"&amp;gt;
          &amp;lt;query&amp;gt;search DisplayName="software1*" | rex "DisplayVersion=(?&amp;lt;versionD1&amp;gt;\d+)" | rex "DisplayVersion=\d+.(?&amp;lt;versionD2&amp;gt;\d+)" | rex "DisplayVersion=\d+.\d+.(?&amp;lt;versionD3&amp;gt;\d+)" | rex "DisplayVersion=\d+.\d+.\d+.(?&amp;lt;versionD4&amp;gt;\d+)" | sort host -versionD1 -versionD2 -versionD3 -versionD4 | streamstats count by host | where count=1 | eval Version = versionD1.".".versionD2.".".versionD3.".".versionD4 | dedup host, DisplayName, DisplayVersion | dedup host, DisplayName, DisplayVersion | stats estdc(host) as HostsWithPackage by DisplayName DisplayVersion&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;Hosts_missing_packages&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults
 | eval Hosts_missing_packages=$tokhost$-$tokpack$ |table Hosts_missing_packages&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;@d&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Can someone suggest how do I pass the list values from both the searches to my final panel and find the missing list of servers. 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Jul 2018 06:31:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-same-query-for-all-the-panels-with-different-search-value/m-p/378468#M168059</guid>
      <dc:creator>psmp</dc:creator>
      <dc:date>2018-07-28T06:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Use same query for all the panels with different search value for just one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-same-query-for-all-the-panels-with-different-search-value/m-p/378469#M168060</link>
      <description>&lt;P&gt;OKay, I saw your other question and gave it a different answer.  Here's another way of looking at this.&lt;/P&gt;

&lt;P&gt;1) You need the first (most recent) record for each host for each DisplayName, along with DisplayVersion.  If there is none, then you want a record that says "Not Installed".  How about if we put "Not Installed" or "None" in the DisplayVersion in that case?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=powershell  source="powershell://CCT-InstalledSoftware" sourcetype=CCT_Software host ="UE1*A01"
 | dedup host, DisplayName
 | appendpipe 
    [| stats values(DisplayName) as DisplayName
     | eval killme="killme"
     | append [
         | metadata type=hosts 
         | where  host ="UE1*A01" 
         | table host 
         | eval DisplayVersion = "Not Installed" ]
     |  eventstats values(DisplayName) as DisplayName
     | where isnull(killme)
     |  mvexpand DisplayName]
 | dedup host, DisplayName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will get you one record for each host... you can update the metadata call with whatever limitations you want on the entire list.  Don't worry about the fact that some of the host will have already been found to have software - those dup events will come after the real records and will be killed by the second &lt;CODE&gt;dedup&lt;/CODE&gt; command. &lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 03:38:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-same-query-for-all-the-panels-with-different-search-value/m-p/378469#M168060</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-07-30T03:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Use same query for all the panels with different search value for just one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-same-query-for-all-the-panels-with-different-search-value/m-p/378470#M168061</link>
      <description>&lt;P&gt;Hi DalJeanis,&lt;/P&gt;

&lt;P&gt;Thanks for your reply. But this gives only the installed Versions and still not displaying the missing hosts. &lt;/P&gt;

&lt;P&gt;I found another way of doing it.&lt;/P&gt;

&lt;P&gt;i calculated the no of hosts missing the softwares. If its greater than zero, I run a search which just displays the hostnames that do not have the software.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;

&lt;P&gt;Also one more QQ. How do I edit the my question in answers.splunk.com?? &lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 16:42:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-same-query-for-all-the-panels-with-different-search-value/m-p/378470#M168061</guid>
      <dc:creator>psmp</dc:creator>
      <dc:date>2018-07-31T16:42:04Z</dc:date>
    </item>
  </channel>
</rss>

