<?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 would I use multiple values from a subsearch as input to the main search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/234125#M69568</link>
    <description>&lt;P&gt;This will not work because say for example I had 1000 addresses  for the zip code 11111 in the potential clients sourcetype and no actual clients in that zip code  but had 20 clients  in zip code 22222 but only an additional 300 addresses for potential clients in zip code 22222.&lt;/P&gt;

&lt;P&gt;In this case the search would place the zip where i have no clients higher in the list.&lt;/P&gt;

&lt;P&gt;I really do need to identify the top zips for existing clients and then use that as input to search the potential clients sourcetype.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Nov 2015 00:55:55 GMT</pubDate>
    <dc:creator>digital_alchemy</dc:creator>
    <dc:date>2015-11-13T00:55:55Z</dc:date>
    <item>
      <title>How would I use multiple values from a subsearch as input to the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/234123#M69566</link>
      <description>&lt;P&gt;I have two sourcetypes "clients" and "potential_clients" and each sourcetype contains address information.   I want to focus marketing in areas where I have the most existing clients, so I would like to run a sub-=search against the "clients" sourcetype to identify the top 20 zip codes of of the existing clients, then use those zip codes as input to search and identify the the addresses in the "potential_clients" sourcetype matching those zip codes.&lt;/P&gt;

&lt;P&gt;This is what I've got so far, but it's not working like I thought it would.  The zip code for both source types is "Property Zip"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="potential_clients" [search sourcetype=*clients* | top limit=20 "Property Zip" | fields + "Property Zip" | rename "Property Zip" as search ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:54:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/234123#M69566</guid>
      <dc:creator>digital_alchemy</dc:creator>
      <dc:date>2020-09-29T07:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: How would I use multiple values from a subsearch as input to the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/234124#M69567</link>
      <description>&lt;P&gt;Not sure you need a subsearch. This may give you what you're looking for&lt;/P&gt;

&lt;P&gt;(sourcetype="potential_clients" OR sourcetype="clients") | top limit=20 "Property Zip" by sourcetype&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 00:20:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/234124#M69567</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-11-13T00:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: How would I use multiple values from a subsearch as input to the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/234125#M69568</link>
      <description>&lt;P&gt;This will not work because say for example I had 1000 addresses  for the zip code 11111 in the potential clients sourcetype and no actual clients in that zip code  but had 20 clients  in zip code 22222 but only an additional 300 addresses for potential clients in zip code 22222.&lt;/P&gt;

&lt;P&gt;In this case the search would place the zip where i have no clients higher in the list.&lt;/P&gt;

&lt;P&gt;I really do need to identify the top zips for existing clients and then use that as input to search the potential clients sourcetype.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 00:55:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/234125#M69568</guid>
      <dc:creator>digital_alchemy</dc:creator>
      <dc:date>2015-11-13T00:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: How would I use multiple values from a subsearch as input to the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/234126#M69569</link>
      <description>&lt;P&gt;Ok I figured it out....  the format command is what I needed.&lt;/P&gt;

&lt;P&gt;This search does exactly what I need.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=potential_clients [search sourcetype=clients | top "Property Zip" limit=25 | table "Property Zip" | format]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Nov 2015 01:11:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/234126#M69569</guid>
      <dc:creator>digital_alchemy</dc:creator>
      <dc:date>2015-11-13T01:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: How would I use multiple values from a subsearch as input to the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/234127#M69570</link>
      <description>&lt;P&gt;Try this &lt;CODE&gt;sourcetype="potential_clients" [search sourcetype="clients" | top limit=20 "Property Zip" | return "Property Zip"]&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 01:19:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-would-I-use-multiple-values-from-a-subsearch-as-input-to-the/m-p/234127#M69570</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-11-13T01:19:22Z</dc:date>
    </item>
  </channel>
</rss>

