<?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: How to pull events with multiple sourcetype in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-events-with-multiple-sourcetype/m-p/427391#M171679</link>
    <description>&lt;P&gt;I believe you have too many "OR"s.&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" sourcetype=splunkd OR sourcetype=splunkd_access component=root OR component=Metrics | stats count(eval(component="Metrics")) as Metrics_count, count(eval(component="root")) as Root_count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Written differently:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" (sourcetype=splunkd OR sourcetype=splunkd_access) AND (component=root OR component=Metrics) | stats count(eval(component="Metrics")) as Metrics_count, count(eval(component="root")) as Root_count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 26 Apr 2019 07:42:48 GMT</pubDate>
    <dc:creator>whrg</dc:creator>
    <dc:date>2019-04-26T07:42:48Z</dc:date>
    <item>
      <title>How to pull events with multiple sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-events-with-multiple-sourcetype/m-p/427390#M171678</link>
      <description>&lt;P&gt;I am searching events with specific multiple sourcetype, but getting extra sourcetype.Kindly refer attached file.&lt;/P&gt;

&lt;P&gt;Am searching sourcetype=splunkd OR sourcetype=splunkd_access&lt;/P&gt;

&lt;P&gt;index="_internal" sourcetype=splunkd OR sourcetype=splunkd_access OR component=root OR component=Metrics  | stats count(eval(component="Metrics")) as Metrics_count, count(eval(component="root")) as Root_count by sourcetype&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:15:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-events-with-multiple-sourcetype/m-p/427390#M171678</guid>
      <dc:creator>rakesh44</dc:creator>
      <dc:date>2020-09-30T00:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull events with multiple sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-events-with-multiple-sourcetype/m-p/427391#M171679</link>
      <description>&lt;P&gt;I believe you have too many "OR"s.&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" sourcetype=splunkd OR sourcetype=splunkd_access component=root OR component=Metrics | stats count(eval(component="Metrics")) as Metrics_count, count(eval(component="root")) as Root_count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Written differently:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" (sourcetype=splunkd OR sourcetype=splunkd_access) AND (component=root OR component=Metrics) | stats count(eval(component="Metrics")) as Metrics_count, count(eval(component="root")) as Root_count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Apr 2019 07:42:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-events-with-multiple-sourcetype/m-p/427391#M171679</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2019-04-26T07:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull events with multiple sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-events-with-multiple-sourcetype/m-p/427392#M171680</link>
      <description>&lt;P&gt;It is due to the OR condition you have in your search query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" sourcetype="splunkd" OR sourcetype="splunkd_access" OR component=root OR component=Metrics | rest  of the search
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It will bring all records which satisfies anyone of the condition, and when a record is found with "component=root" it is of sourcetype &lt;STRONG&gt;splunk_web_service&lt;/STRONG&gt;.&lt;BR /&gt;
So, if you don't want records from a particular sourcetype you can either filter that out using &lt;STRONG&gt;where clause&lt;/STRONG&gt; or you can update your search to have AND condition as shown in the below command,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" sourcetype="splunkd" OR sourcetype="splunkd_access" AND (component=root OR component=Metrics) |rest of the search
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:15:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-events-with-multiple-sourcetype/m-p/427392#M171680</guid>
      <dc:creator>splunk_sv</dc:creator>
      <dc:date>2020-09-30T00:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull events with multiple sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-events-with-multiple-sourcetype/m-p/427393#M171681</link>
      <description>&lt;P&gt;I'm agree with @whrg.&lt;/P&gt;

&lt;P&gt;In my opinion, I think the boolean operators ( &lt;CODE&gt;AND&lt;/CODE&gt;, &lt;CODE&gt;OR&lt;/CODE&gt;, &lt;CODE&gt;NOT&lt;/CODE&gt;)  command should be included in "( )" such as &lt;CODE&gt;index="_internal" (sourcetype=splunkd OR sourcetype=splunkd_access) (component=root OR component=Metric)&lt;/CODE&gt;&lt;BR /&gt;
When you are using  command "search" without any boolean operators, splunk will fill an &lt;CODE&gt;AND&lt;/CODE&gt; between the search conditions. For example, &lt;CODE&gt;index=_internal sourcetype=splunkd&lt;/CODE&gt; is equals that &lt;CODE&gt;index=_internal AND sourcetype=splunkd&lt;/CODE&gt;.&lt;BR /&gt;
In your case, &lt;CODE&gt;sourcetype=*&lt;/CODE&gt; and &lt;CODE&gt;component=*&lt;/CODE&gt; are not conflicting conditions so maybe you should better to use &lt;CODE&gt;AND&lt;/CODE&gt; or nothing between them.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 08:08:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-events-with-multiple-sourcetype/m-p/427393#M171681</guid>
      <dc:creator>aojie654</dc:creator>
      <dc:date>2019-04-26T08:08:22Z</dc:date>
    </item>
  </channel>
</rss>

