<?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: Keep a search from excluding results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Keep-a-search-from-excluding-results/m-p/167735#M47762</link>
    <description>&lt;P&gt;If I understand you correctly, like this (using parentheses to ensure proper logic):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=blah ((sourcetype=1 field="blah") OR (sourcetype=2)) | ...| stats count by sourcetype'
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 19 Jun 2015 16:35:03 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-06-19T16:35:03Z</dc:date>
    <item>
      <title>Keep a search from excluding results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Keep-a-search-from-excluding-results/m-p/167734#M47761</link>
      <description>&lt;P&gt;I have a search which pulls from two different sourcetypes on the same index. In this search I specifically call out '| search &amp;lt;field&amp;gt;=blah', however only one of the sourcetypes contains that field so the search effectively excludes all data from the other sourcetype. &lt;/P&gt;

&lt;P&gt;As I have to keep my search setup like so 'index=blah sourcetype=1 OR sourcetype=2 |...| stats count by sourcetype' I cannot simply append them together like I'd hoped. Additionally, searching for my field parameter in that setup does the same exclusion of data, ex: index=blah sourcetype=1 field="blah" OR sourcetype=2 | ...| stats count by sourcetype'.&lt;/P&gt;

&lt;P&gt;My question being, is there a way to run this query with my specific field search that won't exclude the data from the second sourcetype?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2015 16:30:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Keep-a-search-from-excluding-results/m-p/167734#M47761</guid>
      <dc:creator>pepper_seattle</dc:creator>
      <dc:date>2015-06-19T16:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Keep a search from excluding results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Keep-a-search-from-excluding-results/m-p/167735#M47762</link>
      <description>&lt;P&gt;If I understand you correctly, like this (using parentheses to ensure proper logic):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=blah ((sourcetype=1 field="blah") OR (sourcetype=2)) | ...| stats count by sourcetype'
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Jun 2015 16:35:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Keep-a-search-from-excluding-results/m-p/167735#M47762</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-19T16:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Keep a search from excluding results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Keep-a-search-from-excluding-results/m-p/167736#M47763</link>
      <description>&lt;P&gt;There are a few options. Parenthesis is one option... e.g. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=blah ( (sourcetype=1 field="blah") OR sourcetype=2 ) | ... | stats count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Another option may be &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/multisearch"&gt;multisearch&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multisearch [search index=blah sourcetype=1 field="blah"] [search index=blah sourcetype=2] | ... | stats count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(multisearch is cooler when you have different streaming commands to apply to each subsearch.)&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2015 16:37:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Keep-a-search-from-excluding-results/m-p/167736#M47763</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-06-19T16:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Keep a search from excluding results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Keep-a-search-from-excluding-results/m-p/167737#M47764</link>
      <description>&lt;P&gt;Thanks to both of you!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2015 16:42:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Keep-a-search-from-excluding-results/m-p/167737#M47764</guid>
      <dc:creator>pepper_seattle</dc:creator>
      <dc:date>2015-06-19T16:42:13Z</dc:date>
    </item>
  </channel>
</rss>

