<?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: Why am I getting error &amp;quot;Unknown search command 'sourcetype'&amp;quot; using a subsearch in a where command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260935#M78301</link>
    <description>&lt;P&gt;Hi try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=SplunkKafka_messaging | spath input=msg_body | where passenger_count &amp;gt; [search sourcetype=SplunkRabbitMQ_messaging | spath input=msg_body | stats avg(passenger_count)]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 23 May 2016 10:03:58 GMT</pubDate>
    <dc:creator>NOUMSSI</dc:creator>
    <dc:date>2016-05-23T10:03:58Z</dc:date>
    <item>
      <title>Why am I getting error "Unknown search command 'sourcetype'" using a subsearch in a where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260934#M78300</link>
      <description>&lt;P&gt;I want to do something like the below command but it is giving me an error.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=SplunkKafka_messaging | spath input=msg_body | where passenger_count &amp;gt; [sourcetype=SplunkRabbitMQ_messaging | spath input=msg_body | stats avg(passenger_count)]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Error: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Unknown search command 'sourcetype'.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can anyone let me know how to achieve the objective? My aim is to extract the events where passenger_count is greater then the average of that column.&lt;/P&gt;

&lt;P&gt;This will happen in real time.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 09:04:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260934#M78300</guid>
      <dc:creator>maximus_reborn</dc:creator>
      <dc:date>2016-05-23T09:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "Unknown search command 'sourcetype'" using a subsearch in a where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260935#M78301</link>
      <description>&lt;P&gt;Hi try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=SplunkKafka_messaging | spath input=msg_body | where passenger_count &amp;gt; [search sourcetype=SplunkRabbitMQ_messaging | spath input=msg_body | stats avg(passenger_count)]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 May 2016 10:03:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260935#M78301</guid>
      <dc:creator>NOUMSSI</dc:creator>
      <dc:date>2016-05-23T10:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "Unknown search command 'sourcetype'" using a subsearch in a where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260936#M78302</link>
      <description>&lt;P&gt;Dont forget to accept my answer if you were satisfied&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 12:03:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260936#M78302</guid>
      <dc:creator>NOUMSSI</dc:creator>
      <dc:date>2016-05-23T12:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "Unknown search command 'sourcetype'" using a subsearch in a where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260937#M78303</link>
      <description>&lt;P&gt;I am getting 2 errors:&lt;BR /&gt;
 1. Error reading runtime settings: File :/usr/local/splunk/var/run/splunk/dispatch/subsearch_1464015531.154_1464015531.1/runtime.csv does not exist&lt;BR /&gt;
 2. ERROR dispatchRunner - RunDispatch::runDispatchThread threw error: Error in 'where' command: Typechecking failed. The '&amp;gt;' operator received different types&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:45:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260937#M78303</guid>
      <dc:creator>maximus_reborn</dc:creator>
      <dc:date>2020-09-29T09:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "Unknown search command 'sourcetype'" using a subsearch in a where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260938#M78304</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=SplunkKafka_messaging | spath input=msg_body | where passenger_count &amp;gt; [search sourcetype=SplunkRabbitMQ_messaging | spath input=msg_body | stats avg(passenger_count) as avg | return $avg]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=SplunkKafka_messaging | spath input=msg_body | where passenger_count &amp;gt; [search sourcetype=SplunkRabbitMQ_messaging | spath input=msg_body | stats avg(passenger_count) as query]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 May 2016 15:48:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260938#M78304</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-05-23T15:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "Unknown search command 'sourcetype'" using a subsearch in a where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260939#M78305</link>
      <description>&lt;P&gt;Thanks! It did work.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 15:59:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260939#M78305</guid>
      <dc:creator>maximus_reborn</dc:creator>
      <dc:date>2016-05-23T15:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "Unknown search command 'sourcetype'" using a subsearch in a where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260940#M78306</link>
      <description>&lt;P&gt;try to insert  'search' before sourcetype&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 15:40:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-Unknown-search-command-sourcetype/m-p/260940#M78306</guid>
      <dc:creator>philippiq</dc:creator>
      <dc:date>2017-05-26T15:40:14Z</dc:date>
    </item>
  </channel>
</rss>

