<?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: Subsearch Help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416190#M119809</link>
    <description>&lt;P&gt;It is OK to keep the &lt;CODE&gt;| format&lt;/CODE&gt; in your search, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="*" sourcetype=endpoints [ search index="*" signature="sig_id"  | dedup dest | rename dest AS client_name | table client_name | format ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Mar 2019 15:35:41 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-03-07T15:35:41Z</dc:date>
    <item>
      <title>Subsearch Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416185#M119804</link>
      <description>&lt;P&gt;I have the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="*" sourcetype=endpoints [search index="*" signature="sig_id" | dedup dest | fields dest ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which produces no results.&lt;/P&gt;

&lt;P&gt;Doing each of these, independently works...&lt;BR /&gt;
For example, the subsearch:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="*" signature="sig_id" | dedup dest | fields dest
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;gives me a nice stats table with hostname_1, hostname_2, etc.&lt;/P&gt;

&lt;P&gt;And if I manually define this in the main search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="*" sourcetype=endpoints hostname_1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get all of my events.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:30:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416185#M119804</guid>
      <dc:creator>richardphung</dc:creator>
      <dc:date>2020-09-29T23:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416186#M119805</link>
      <description>&lt;P&gt;So your subsearch produces a field named "dest". Is there a "dest" field (containing hostname_1, hostname_2, etc.) available in the primary search?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:30:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416186#M119805</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2020-09-29T23:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416187#M119806</link>
      <description>&lt;P&gt;Figured it out...&lt;BR /&gt;
the field dest doesn't exist in the main search.. need to rename field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="*" sourcetype=endpoints [search index="*" signature="sig_id"  | dedup dest 
    | rename dest AS client_name | table client_name]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Mar 2019 18:23:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416187#M119806</guid>
      <dc:creator>richardphung</dc:creator>
      <dc:date>2019-03-06T18:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416188#M119807</link>
      <description>&lt;P&gt;You should always use &lt;CODE&gt;| format&lt;/CODE&gt; at the end of your subsearch so that you can see what it is creating.  If you had done so, you would have seen that your subsearch is using the field name in the SPL that it generates (like &lt;CODE&gt;dest="value"&lt;/CODE&gt;).  Based on your test search, you need just the value so try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="*" sourcetype=endpoints [search index="*" signature="sig_id" | dedup dest | fields dest | format "(" "" "" "" "OR" ")" | rex field=search mode=sed "s/dest=//g"]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Mar 2019 03:40:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416188#M119807</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-07T03:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416189#M119808</link>
      <description>&lt;P&gt;This is a great tip.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 14:24:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416189#M119808</guid>
      <dc:creator>richardphung</dc:creator>
      <dc:date>2019-03-07T14:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416190#M119809</link>
      <description>&lt;P&gt;It is OK to keep the &lt;CODE&gt;| format&lt;/CODE&gt; in your search, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="*" sourcetype=endpoints [ search index="*" signature="sig_id"  | dedup dest | rename dest AS client_name | table client_name | format ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Mar 2019 15:35:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416190#M119809</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-07T15:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416191#M119810</link>
      <description>&lt;P&gt;Hi guys, I hope I can borrow your fantastic brains on this one, I have the same concept, I want to check the top failed ip that authenticated afterwards:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search_for_authenticated_users&amp;gt; ip [&amp;lt;search_for_failed_user&amp;gt;| top limit=100 client_ip | rename clientip AS ip | table ip ] | top  user ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope someone can shed some light, or direct me somewhere where some else has faced the same problem.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2019 15:35:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-Help/m-p/416191#M119810</guid>
      <dc:creator>yassinesakri</dc:creator>
      <dc:date>2019-12-21T15:35:03Z</dc:date>
    </item>
  </channel>
</rss>

