<?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: Search result as input to another search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89180#M22868</link>
    <description>&lt;P&gt;I did try the subsearch, however i kept running into the error "Error in 'fields' command: Invalid argument: 'fieldname=field_value'.&lt;/P&gt;

&lt;P&gt;Then I ran into one of the Answers on another post, saying I Should add "|rename field as query".  This one doesn't go into errors but doesn't get results either.&lt;/P&gt;

&lt;P&gt;I'm looking into a document about creating State Tables.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2013 02:27:56 GMT</pubDate>
    <dc:creator>mcm10285</dc:creator>
    <dc:date>2013-03-01T02:27:56Z</dc:date>
    <item>
      <title>Search result as input to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89175#M22863</link>
      <description>&lt;P&gt;Hi, anybody has an idea on how to get a value from one search and input it to another search, then display them in a table?  Sample below.&lt;/P&gt;

&lt;P&gt;I’ll search for IP_Address on 1st search, then take that into 2nd search and find the Hostnames of those ip address…then display them&lt;/P&gt;

&lt;P&gt;Search1:&lt;/P&gt;

&lt;P&gt;sourcetype=srctype1 OR sourcetyp=srctype2 dstIP=1.1.1.1 OR dstIP=2.2.2.2|fields + srcIP dstIP|stats count by srcIP&lt;/P&gt;

&lt;P&gt;Search2:&lt;/P&gt;

&lt;P&gt;sourcetype=srctype3 &lt;EM&gt;(input srcIP from Search1)&lt;/EM&gt;|fields + Hostname|stats count by srcIP Hostname&lt;/P&gt;

&lt;P&gt;Display Table:&lt;/P&gt;

&lt;P&gt;srcIP__________Hostname &lt;/P&gt;

&lt;P&gt;a.b.c.d_______________abcd&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2012 08:20:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89175#M22863</guid>
      <dc:creator>mcm10285</dc:creator>
      <dc:date>2012-07-03T08:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Search result as input to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89176#M22864</link>
      <description>&lt;P&gt;This is exactly what subsearches were made for. Have a look at the docs that cover this:&amp;nbsp;&lt;BR /&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/Useasubsearch" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/Useasubsearch&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 17:22:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89176#M22864</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2023-10-30T17:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Search result as input to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89177#M22865</link>
      <description>&lt;P&gt;I'm not sure if I understood your question, but you should try something like :&lt;/P&gt;

&lt;P&gt;sourcetype=srctype3 | join [ search sourcetype=srctype1 OR sourcetyp=srctype2 dstIP=1.1.1.1 OR dstIP=2.2.2.2 | fields + srcIP dstIP | stats count by srcIP ] | fields + Hostname | stats count by srcIP Hostname &lt;/P&gt;

&lt;P&gt;And see what you get. Let me know if it helps you.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2012 11:32:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89177#M22865</guid>
      <dc:creator>ysouchon</dc:creator>
      <dc:date>2012-07-03T11:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Search result as input to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89178#M22866</link>
      <description>&lt;P&gt;This is really an old post, but I'm still looking for a way here. The join doesn't seem to resolve this as it mixes the results.&lt;/P&gt;

&lt;P&gt;Just to be exact, I want to match an IP address from a proxy log to a device name or username from AD logs since there is no device name in the proxy logs.  I want to input the IP address seen in proxy logs to the AD logs search for device name.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2013 06:01:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89178#M22866</guid>
      <dc:creator>mcm10285</dc:creator>
      <dc:date>2013-02-28T06:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Search result as input to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89179#M22867</link>
      <description>&lt;P&gt;As Ayn said, subsearch is what you want. Perform a subsearch for the proxy event then feed that into a search through ad logs. It should look something like:&lt;/P&gt;

&lt;P&gt;sourcetype=ad_logs [search sourcetype=proxy_logs &lt;INFO_YOU_ARE_LOOKING_FOR_IN_THE_PROXY_LOGS&gt; | fields ip_address] | table user ip_address&lt;/INFO_YOU_ARE_LOOKING_FOR_IN_THE_PROXY_LOGS&gt;&lt;/P&gt;

&lt;P&gt;Keep in mind the above assumes your proxy logs have the ip address in a fields called ip_address, and your ad logs have the username and ip address in fields user and ip_address respectively&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:24:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89179#M22867</guid>
      <dc:creator>mbenwell</dc:creator>
      <dc:date>2020-09-28T13:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Search result as input to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89180#M22868</link>
      <description>&lt;P&gt;I did try the subsearch, however i kept running into the error "Error in 'fields' command: Invalid argument: 'fieldname=field_value'.&lt;/P&gt;

&lt;P&gt;Then I ran into one of the Answers on another post, saying I Should add "|rename field as query".  This one doesn't go into errors but doesn't get results either.&lt;/P&gt;

&lt;P&gt;I'm looking into a document about creating State Tables.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2013 02:27:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89180#M22868</guid>
      <dc:creator>mcm10285</dc:creator>
      <dc:date>2013-03-01T02:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Search result as input to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89181#M22869</link>
      <description>&lt;P&gt;Uh, wouldn't be better to put your energy into troubleshooting your syntax problems with the probably best approach to solving your problems, rather than trying something else just because you couldn't get it right?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2013 08:04:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89181#M22869</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-03-01T08:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Search result as input to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89182#M22870</link>
      <description>&lt;P&gt;When you get errors like that, you should read the search command reference for that command. Specifically, with regards to the fields command, you're not using it properly.&lt;/P&gt;

&lt;P&gt;Fields command synopsis: Keeps or removes fields from search results.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2013 02:00:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89182#M22870</guid>
      <dc:creator>mbenwell</dc:creator>
      <dc:date>2013-03-02T02:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Search result as input to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89183#M22871</link>
      <description>&lt;P&gt;just trying to get back on old questions....subsearch is definitely the way to go but not efficient for multiple subsearch results.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2013 05:38:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89183#M22871</guid>
      <dc:creator>mcm10285</dc:creator>
      <dc:date>2013-06-25T05:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Search result as input to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89184#M22872</link>
      <description>&lt;P&gt;The link in the Accepted Answer &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/User/HowSubsearchesWork"&gt;link text&lt;/A&gt; seems to no longer reach an answer to this question because of update to SPLUNK.  When I try it I get page that says:&lt;/P&gt;

&lt;P&gt;Hi! Just wanted to let you know:&lt;/P&gt;

&lt;P&gt;The topic you've asked to see does not apply to the most recent version.&lt;/P&gt;

&lt;P&gt;To search the latest version of the documentation, click Search&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jul 2018 16:03:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-result-as-input-to-another-search/m-p/89184#M22872</guid>
      <dc:creator>tuxmein</dc:creator>
      <dc:date>2018-07-17T16:03:48Z</dc:date>
    </item>
  </channel>
</rss>

