<?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: Missing subsearch results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390103#M113624</link>
    <description>&lt;P&gt;So I think I figured out why only some results are displaying, but I still can't figure out a good solution.  Basically, when I search an Application name, results are only displayed from cms_app_server because there is an Application column in that index.  In the cms_db_server index no Application column exists. &lt;/P&gt;

&lt;P&gt;However, in the results I can see Applications tied to VMs from the cms_db_server index.  It's just when I try to search an App name that the results are limited.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 20:03:22 GMT</pubDate>
    <dc:creator>gbwilson</dc:creator>
    <dc:date>2020-09-29T20:03:22Z</dc:date>
    <item>
      <title>Missing subsearch results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390100#M113621</link>
      <description>&lt;P&gt;I've created a search that is composed of two subsearches.  I have a dashboard where if I search an application name, it tells me all the underlying infrastructure that supports that app.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=cms_db_server OR index=cms_app_server) 
| join type=left max=0 Database,InstanceName [search index="cms_app_db"]
| join type=left max=0 VM [search (index="cms_vm")]
| dedup Host VM Application
| table Host VM Application
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Above is the search that I'm using.  When I use this query, data from both subsearches is displayed.  However, if I limit the search by application name, I only see results from one of the joins, not both.  Why is it that when I query the search as is above- I can see the data from both subsearches, but when I limit the search by an app name the results from one subsearch is not displayed?&lt;/P&gt;

&lt;P&gt;Any insight would be helpful as I am new to Splunk.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 17:56:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390100#M113621</guid>
      <dc:creator>gbwilson</dc:creator>
      <dc:date>2018-06-20T17:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Missing subsearch results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390101#M113622</link>
      <description>&lt;P&gt;You would have to show us how you added the limitation for the application name &lt;/P&gt;

&lt;P&gt;However, we can help you clear up the search results a bit.  Remove from each of these &lt;CODE&gt;fields&lt;/CODE&gt; commands any fields that don't exist on that branch of the search...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (index=cms_db_server OR index=cms_app_server) 
| fields  Host, VM, Database, InstanceName, Application 
| join type=left max=0 Database,InstanceName [
    search index="cms_app_db" 
    | fields  Host, VM, Database, InstanceName, Application
    ]
| fields  Host, VM, Database, InstanceName, Application
| join type=left max=0 VM [
    search (index="cms_vm") 
    | fields  Host, VM, Database, InstanceName, Application
    ]
| dedup Host VM Application
| table Host VM Application
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;My assumption is that, since you only need three fields, and you have two joins, you are using the  Database and InstanceName to get the VM, and then the VM to get the Host, something like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (index=cms_db_server OR index=cms_app_server) 
| fields  Application, Database, InstanceName 
| join type=left max=0 Database,InstanceName [
    search index="cms_app_db" 
    | fields  VM, Database, InstanceName
    ]
| fields  VM, Database, InstanceName, Application
| join type=left max=0 VM [
    search (index="cms_vm") 
    | fields  Host, VM
    ]
| dedup Host VM Application
| table Host VM Application
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...and so you should be able to add this line after the first line to limit the Application value...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where Application="foo"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;... however, you could also just leave the earlier part in a base search, and have a post-processing query that does the same thing to limit the results to your requested application. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where Application="foo"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jun 2018 23:17:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390101#M113622</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-06-20T23:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Missing subsearch results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390102#M113623</link>
      <description>&lt;P&gt;@DalJeanis &lt;/P&gt;

&lt;P&gt;Thanks for your help, the second search you sent works well enough.  However, I'm still not getting all the results I should be seeing.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=cms_db_server OR index=cms_app_server) $appservicefield$
 | fields  VM, Application, Database, InstanceName 
 | join type=left max=0 Database,InstanceName [
     search index="cms_app_db" 
     | fields  VM, Database, InstanceName
     ]
 | fields  VM, Database, InstanceName, Application
 | join type=left max=0 VM [
     search (index="cms_vm") 
     | fields  Host, VM
     ]
 | dedup Host VM Application
 | table Host VM Application
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I really want to see these results displayed in a dashboard.  I'm trying to use a token to search on the Application name.  I'm still only seeing results from one join.  If I name an Application where data is coming from both joins, the search results from one join don't display for some reason still. &lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 14:22:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390102#M113623</guid>
      <dc:creator>gbwilson</dc:creator>
      <dc:date>2018-06-21T14:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Missing subsearch results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390103#M113624</link>
      <description>&lt;P&gt;So I think I figured out why only some results are displaying, but I still can't figure out a good solution.  Basically, when I search an Application name, results are only displayed from cms_app_server because there is an Application column in that index.  In the cms_db_server index no Application column exists. &lt;/P&gt;

&lt;P&gt;However, in the results I can see Applications tied to VMs from the cms_db_server index.  It's just when I try to search an App name that the results are limited.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:03:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390103#M113624</guid>
      <dc:creator>gbwilson</dc:creator>
      <dc:date>2020-09-29T20:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Missing subsearch results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390104#M113625</link>
      <description>&lt;P&gt;Figured it out.  Thanks for your help!  Worked through it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=cms_app_db) OR (index=cms_app_server)  Atlassian
 | fields  Application, VM, Database, InstanceName
 | join type=outer max=0 Database, InstanceName [
     search index="cms_db_server" 
     | fields  VM, Application, Database, InstanceName
     ]
 | fields  VM, Application, Database, InstanceName
 | join type=outer max=0 VM [
     search (index="cms_vm") 
     | fields  Host, VM
     ]
 | dedup Host VM Application
 | table Host VM Application
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Had to switch a few indexes around and add a field to row 5.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 16:44:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390104#M113625</guid>
      <dc:creator>gbwilson</dc:creator>
      <dc:date>2018-06-21T16:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Missing subsearch results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390105#M113626</link>
      <description>&lt;P&gt;@gbwilson, you should click &lt;CODE&gt;Accept&lt;/CODE&gt; to give @daljeanis the points and close the question!&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jun 2018 23:42:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390105#M113626</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-06-30T23:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Missing subsearch results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390106#M113627</link>
      <description>&lt;P&gt;@gbwilson - yes, the hardest part of these "splunk stew" solutions, when they don't all have a common key, is to roll the data together in the right order.  &lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 22:15:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Missing-subsearch-results/m-p/390106#M113627</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-07-02T22:15:30Z</dc:date>
    </item>
  </channel>
</rss>

