<?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: Help combining results from different searches, append vs. multisearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-combining-results-from-different-searches-append-vs/m-p/378885#M111043</link>
    <description>&lt;P&gt;why not just &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=testindex sourcetype=host source="testindex://hostSoftware"  host=prod1*  
| eval FoundSoftware=if(DisplayName="anysoftware*",1,0)
| chart max(FoundSoftware) by host DisplayName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will give you a chart with 1's for each host for each software that was found, and 0 for each software not found on that host.&lt;/P&gt;

&lt;P&gt;You can switch &lt;CODE&gt;host&lt;/CODE&gt; and &lt;CODE&gt;DisplayName&lt;/CODE&gt; if you prefer the opposite orientation.&lt;/P&gt;

&lt;P&gt;Then you can use the above results to calculate the two pieces of information that you want.&lt;/P&gt;

&lt;P&gt;It you want to untable the results into one record per host per DisplayName, then this command will achieve that.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| untable host DisplayName FoundSoftware
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 30 Jul 2018 03:18:14 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2018-07-30T03:18:14Z</dc:date>
    <item>
      <title>Help combining results from different searches, append vs. multisearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-combining-results-from-different-searches-append-vs/m-p/378883#M111041</link>
      <description>&lt;H2&gt;&lt;STRONG&gt;Moderator Note:&lt;/STRONG&gt; the below was originally posted as an Answer on &lt;A href="https://answers.splunk.com/answers/294431/how-to-combine-two-searches-into-one-and-display-a.html"&gt;an old question&lt;/A&gt;, but being it's own question it has been split out accordingly&lt;/H2&gt;

&lt;PRE&gt;&lt;CODE&gt;index=testindex sourcetype=hostSoftware source="testindex://hostSoftware"  host=prod1* DisplayName="anysoftware*" host=prod1*  | dedup host, DisplayName | stats count(host) as #_of_Hosts_with_package by DisplayName, DisplayVersion | append [search index=testindex sourcetype=host source="testindex://hostSoftware"  host=prod1*| table host | search NOT [search iindex=testindex sourcetype=hostSoftware source="testindex://hostSoftware"  host=prod1* | search "DisplayName"="anysoftware*" | dedup host | table host] | rename host as Hosts_Missing_software | stats count(Hosts_Missing_software) as #_Hosts_Missing_LeostreamAgent, list(Hosts_Missing_software) as Hosts_Missing_software]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The append do not yeild all of the results due to maxout limit. So moving to multisearch. &lt;/P&gt;

&lt;P&gt;I am trying to do same search with multisearch but not working. Any help is much appreciated. TIA &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multisearch [search index=testindex sourcetype=hostSoftware source="testindex://hostSoftware"  host=prod1*  | fields hos t| rename host as Hosts_raw_List | eval type="search1" ][index=testindex sourcetype=hostSoftware source="testindex://hostSoftware"  host=prod1* Name="Anysoftware*" | fields host Name Version | rename host as hostwithpack | eval type="search2" ] | eval result=search1-search2.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my search1 results 12 hosts. (total number of hosts available)&lt;BR /&gt;
search 2 results 11 hosts (Hosts with software installed)&lt;/P&gt;

&lt;P&gt;I am looking for results like in table: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Name"    |  Version  |  #ofhosts withsoftware |     #of hosts without software |     list of hosts with no software"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;can anyone pls help!&lt;BR /&gt;
TIA&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 23:13:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-combining-results-from-different-searches-append-vs/m-p/378883#M111041</guid>
      <dc:creator>psmp</dc:creator>
      <dc:date>2018-07-13T23:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help combining results from different searches, append vs. multisearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-combining-results-from-different-searches-append-vs/m-p/378884#M111042</link>
      <description>&lt;H2&gt;In moving this post, a comment providing more details from &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/124961"&gt;@psmp&lt;/a&gt; was lost: &lt;/H2&gt;

&lt;P&gt;Thanks for the reply.&lt;BR /&gt;
index=powershell sourcetype=sw_list source="powershell://cw_list" host=prod* | stats list(host)&lt;/P&gt;

&lt;P&gt;This Query Yields 5 hosts.&lt;BR /&gt;
Host 1&lt;BR /&gt;
Host2&lt;BR /&gt;
Host3&lt;BR /&gt;
Host4&lt;BR /&gt;
Host5&lt;/P&gt;

&lt;P&gt;index=powershell sourcetype=sw_list source="powershell://cw_list" host=prod* packagename="Mysoftware" | stats count(host) by packagename packageversion&lt;/P&gt;

&lt;P&gt;host packageName packageVersion&lt;BR /&gt;
Host1 Mysoftware 1.0&lt;BR /&gt;
Host3 Mysoftware 1.1&lt;BR /&gt;
Host5 Mysoftware 1.0&lt;/P&gt;

&lt;P&gt;I am looking for a Query that Yields below report:&lt;/P&gt;

&lt;P&gt;PackageName PackageVersion Total_hosts_with_pkg Total_hosts_without ListOfHostMissingPack&lt;/P&gt;

&lt;P&gt;Mysoftware 1.0 2 2 Host2&lt;BR /&gt;
Mysoftware 1.1 1 Host4&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:40:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-combining-results-from-different-searches-append-vs/m-p/378884#M111042</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2020-09-29T20:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help combining results from different searches, append vs. multisearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-combining-results-from-different-searches-append-vs/m-p/378885#M111043</link>
      <description>&lt;P&gt;why not just &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=testindex sourcetype=host source="testindex://hostSoftware"  host=prod1*  
| eval FoundSoftware=if(DisplayName="anysoftware*",1,0)
| chart max(FoundSoftware) by host DisplayName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will give you a chart with 1's for each host for each software that was found, and 0 for each software not found on that host.&lt;/P&gt;

&lt;P&gt;You can switch &lt;CODE&gt;host&lt;/CODE&gt; and &lt;CODE&gt;DisplayName&lt;/CODE&gt; if you prefer the opposite orientation.&lt;/P&gt;

&lt;P&gt;Then you can use the above results to calculate the two pieces of information that you want.&lt;/P&gt;

&lt;P&gt;It you want to untable the results into one record per host per DisplayName, then this command will achieve that.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| untable host DisplayName FoundSoftware
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Jul 2018 03:18:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-combining-results-from-different-searches-append-vs/m-p/378885#M111043</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-07-30T03:18:14Z</dc:date>
    </item>
  </channel>
</rss>

