<?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: &amp;quot;Unknown search command&amp;quot; with subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60253#M14847</link>
    <description>&lt;P&gt;"It's trivial to find all"   - top does not return all the SIDS. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[ ... | fields SID | dedup SID ]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;will&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2013 15:54:04 GMT</pubDate>
    <dc:creator>jonuwz</dc:creator>
    <dc:date>2013-03-13T15:54:04Z</dc:date>
    <item>
      <title>"Unknown search command" with subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60248#M14842</link>
      <description>&lt;P&gt;I'm stumbing over subsearches.&lt;/P&gt;

&lt;P&gt;In our system, app server logs contain an SID (session ID). It's trivial to find all (valid/known) SIDs for a given account with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SID!=SID_UNKNOWN sourcetype=unicorn account="customer@example.com" | top SID | table SID 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can also break down the status codes easily:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=unicorn HTTP_CODE&amp;gt;=400 | top HTTP_CODE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I can't figure out how to put the two together using a subsearch. If I try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=unicorn HTTP_CODE&amp;gt;=400 | top HTTP_CODE [ SID!=SID_UNKNOWN sourcetype=unicorn account="customer@example.com" | top SID | table SID ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Unknown search command 'sid'.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What am I missing here?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 15:11:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60248#M14842</guid>
      <dc:creator>chrlshrnbrgr</dc:creator>
      <dc:date>2013-03-13T15:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: "Unknown search command" with subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60249#M14843</link>
      <description>&lt;P&gt;You need to call a command first, such as "search". For the main query that is prepended by default. Something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... [search SID=...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure what you want to do though, since you're passing the result of the subsearch to the top command, which doesn't support this.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 15:13:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60249#M14843</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-03-13T15:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: "Unknown search command" with subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60250#M14844</link>
      <description>&lt;P&gt;Thanks, I figured out the same by looking thru other questions tagged with subsearch. Here's what I ended up with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=unicorn HTTP_CODE&amp;gt;=400 [ | search SID!=SID_UNKNOWN sourcetype=unicorn account=customer@example.com | top SID | table SID ] | top HTTP_CODE
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2013 15:25:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60250#M14844</guid>
      <dc:creator>chrlshrnbrgr</dc:creator>
      <dc:date>2013-03-13T15:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: "Unknown search command" with subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60251#M14845</link>
      <description>&lt;P&gt;Take a look at the return command in the splunk docs as well.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 15:28:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60251#M14845</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-03-13T15:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: "Unknown search command" with subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60252#M14846</link>
      <description>&lt;P&gt;You don't the &lt;CODE&gt;|&lt;/CODE&gt; at the start of the subsearch. It's implicit, which is why there's an error in the first place.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 15:52:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60252#M14846</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-03-13T15:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: "Unknown search command" with subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60253#M14847</link>
      <description>&lt;P&gt;"It's trivial to find all"   - top does not return all the SIDS. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[ ... | fields SID | dedup SID ]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;will&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 15:54:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60253#M14847</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2013-03-13T15:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: "Unknown search command" with subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60254#M14848</link>
      <description>&lt;P&gt;&lt;CODE&gt;top limit=1000&lt;/CODE&gt; or &lt;CODE&gt;top limit=0&lt;/CODE&gt;, but yes, dedup is better if you don't need the ranking and percentages, since it doesn't have to sort or accumulate the total.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 17:30:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-Unknown-search-command-quot-with-subsearch/m-p/60254#M14848</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-03-13T17:30:23Z</dc:date>
    </item>
  </channel>
</rss>

