<?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: Subsearches (and custom fields?) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Subsearches-and-custom-fields/m-p/61599#M15209</link>
    <description>&lt;P&gt;What happens when you put a "format" in the subsearch?   Like does this work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main [search index="main" *CONNECTION | top UUID limit=1 | fields UUID | format ] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've found times where my subsearch will not work without tacking on a &lt;CODE&gt;| format&lt;/CODE&gt; on the end, I'm not sure why, and it doesn't seem like you should have to.  Perhaps someone more familiar with subsearches help explain when you need format and when you do not.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Another thing to look into is using the "Job Inspector" and looking at the "remoteSearch" value.   You should see "litsearch" followed by the expanded form of your search.  You may find something interesting going on here that could explain why your subsearch isn't working properly.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Oct 2010 21:54:48 GMT</pubDate>
    <dc:creator>Lowell</dc:creator>
    <dc:date>2010-10-01T21:54:48Z</dc:date>
    <item>
      <title>Subsearches (and custom fields?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearches-and-custom-fields/m-p/61598#M15208</link>
      <description>&lt;P&gt;I could be doing something wrong, but I can't seem to get subsearches to behave like I expect.  I can get something like the documentation (HowSubsearchesWork) example to work, but anything more complicated seems to fail.&lt;/P&gt;

&lt;P&gt;This query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" *CONNECTION | top host limit=1 | fields host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;shows the host with the most CONNECTION log entries.&lt;/P&gt;

&lt;P&gt;As expected, this query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* [search index="main" *CONNECTION | top host limit=1 | fields host]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;shows all log messages from the host that has the most connection logs.  When I try using a different fields, however, the behavior changes.&lt;/P&gt;

&lt;P&gt;For example, this query shows the most frequent UUIDs (a custom field):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" *CONNECTION | top UUID limit=1 | fields UUID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The following all return "No matching events found.":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* [search index="main" *CONNECTION | top UUID limit=1 | fields UUID]
* [search index="main" *CONNECTION | top UUID limit=1 | fields UUID | rename UUID as query]
* [search index="main" *CONNECTION | top UUID limit=1 | fields UUID | rename UUID as search]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Pasting the output from either of&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" *CONNECTION | top UUID limit=1 | fields UUID | format
index="main" *CONNECTION | top UUID limit=1 | fields UUID | rename UUID as search | format
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;into a new splunk search produces the expected results.&lt;/P&gt;

&lt;P&gt;Could this be a syntax or configuration issue, or do I not understand how subsearches work?  We're on 4.1.3; could this be related to SPL-32669 ?&lt;/P&gt;

&lt;P&gt;thanks in advance,&lt;/P&gt;

&lt;P&gt;rick&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2010 04:41:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearches-and-custom-fields/m-p/61598#M15208</guid>
      <dc:creator>rickschultz</dc:creator>
      <dc:date>2010-10-01T04:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearches (and custom fields?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearches-and-custom-fields/m-p/61599#M15209</link>
      <description>&lt;P&gt;What happens when you put a "format" in the subsearch?   Like does this work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main [search index="main" *CONNECTION | top UUID limit=1 | fields UUID | format ] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've found times where my subsearch will not work without tacking on a &lt;CODE&gt;| format&lt;/CODE&gt; on the end, I'm not sure why, and it doesn't seem like you should have to.  Perhaps someone more familiar with subsearches help explain when you need format and when you do not.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Another thing to look into is using the "Job Inspector" and looking at the "remoteSearch" value.   You should see "litsearch" followed by the expanded form of your search.  You may find something interesting going on here that could explain why your subsearch isn't working properly.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2010 21:54:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearches-and-custom-fields/m-p/61599#M15209</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-10-01T21:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearches (and custom fields?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearches-and-custom-fields/m-p/61600#M15210</link>
      <description>&lt;P&gt;index=main [search index="main" *CONNECTION | top UUID limit=1 | fields UUID | format ]&lt;/P&gt;

&lt;P&gt;also yields "No matching events found."&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2010 01:01:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearches-and-custom-fields/m-p/61600#M15210</guid>
      <dc:creator>rickschultz</dc:creator>
      <dc:date>2010-10-05T01:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearches (and custom fields?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearches-and-custom-fields/m-p/61601#M15211</link>
      <description>&lt;P&gt;Search Job Inspector shows the following, though I'm not sure how to interpret it:&lt;/P&gt;

&lt;P&gt;remoteSearch     | fields keepcolorder=t * "*" "host" "index" "source" "sourcetype" "splunk_server"&lt;/P&gt;</description>
      <pubDate>Sat, 09 Oct 2010 04:12:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearches-and-custom-fields/m-p/61601#M15211</guid>
      <dc:creator>rickschultz</dc:creator>
      <dc:date>2010-10-09T04:12:21Z</dc:date>
    </item>
  </channel>
</rss>

