<?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: Combine multiple search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-search/m-p/589909#M205390</link>
    <description>&lt;P&gt;Thank you very much&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;for timely help.&amp;nbsp; Sure, will make the index name as explicit instead of using *.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Mar 2022 01:56:03 GMT</pubDate>
    <dc:creator>msg4sunil</dc:creator>
    <dc:date>2022-03-21T01:56:03Z</dc:date>
    <item>
      <title>How to combine multiple search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-search/m-p/589901#M205385</link>
      <description>&lt;P&gt;How do combine the below 2 searches into one?&lt;/P&gt;
&lt;P&gt;1. &lt;EM&gt;* orderid|stats count by id&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;returns something like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2022-03-21T00:10:16,999Z ...INFO [thread_id=12349, &lt;STRONG&gt;id&lt;/STRONG&gt;=&lt;FONT color="#339966"&gt;VU53ZQCTTMLPG&lt;/FONT&gt;, .....&lt;BR /&gt;2022-03-21T00:10:16,995Z....INFO [thread_id=549, &lt;STRONG&gt;id&lt;/STRONG&gt;=&lt;FONT color="#339966"&gt;F2PAC6ITNX6O3&lt;/FONT&gt;,&lt;/P&gt;
&lt;P&gt;2. Based on the above response, I need to query as below after fetching the "&lt;STRONG&gt;id&lt;/STRONG&gt;".&amp;nbsp; Note, "id's would vary for different orderid and the number of "id"'s would also vary&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;id IN ("&lt;FONT color="#339966"&gt;VU53ZQCTTMLPG&lt;/FONT&gt;","&lt;FONT color="#339966"&gt;F2PAC6ITNX6O3&lt;/FONT&gt;")&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 17:39:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-search/m-p/589901#M205385</guid>
      <dc:creator>msg4sunil</dc:creator>
      <dc:date>2022-03-21T17:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-search/m-p/589902#M205386</link>
      <description>&lt;P&gt;There are a number of ways to do this, with subsearches, joins or aggregations, but it's not easy to give you an absolute solution.&lt;/P&gt;&lt;P&gt;The most obvious example from your description is the subsearch, which would be something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Your second search [ 
  search your first search
  | stats count by id | fields id
]&lt;/LI-CODE&gt;&lt;P&gt;which would pass the list of ids in the subsearch to the outer search which is effectively doing&amp;nbsp;&lt;/P&gt;&lt;P&gt;(id1 OR id=2 OR id=3..)&lt;/P&gt;&lt;P&gt;as part of the outer search&lt;/P&gt;&lt;P&gt;You can use other techniques, such as searching for all the data in a single search and then manipulating it with eval/stats to get to your desired output, but need more info on that.&lt;/P&gt;&lt;P&gt;join command is an option, but should rarely be the first choice, as 'join' has limitations and is not really the way to do this sort of task in Splunk world&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 00:55:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-search/m-p/589902#M205386</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-03-21T00:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-search/m-p/589907#M205388</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;, can you please give one example?&amp;nbsp; The below doesnt work.&lt;/P&gt;&lt;P&gt;index=* id IN [index=* "985be6370637"| fields id]&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 01:20:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-search/m-p/589907#M205388</guid>
      <dc:creator>msg4sunil</dc:creator>
      <dc:date>2022-03-21T01:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-search/m-p/589908#M205389</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244042"&gt;@msg4sunil&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* [
  search index=* "985be6370637" 
  | stats count by id
  | fields id
]&lt;/LI-CODE&gt;&lt;P&gt;It is not good practice to use index=* - admins do not like users who cast a wide search net - always be as specific as possible when making your search - particularly in this case, you are making two searches.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 01:32:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-search/m-p/589908#M205389</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-03-21T01:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-search/m-p/589909#M205390</link>
      <description>&lt;P&gt;Thank you very much&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;for timely help.&amp;nbsp; Sure, will make the index name as explicit instead of using *.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 01:56:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-search/m-p/589909#M205390</guid>
      <dc:creator>msg4sunil</dc:creator>
      <dc:date>2022-03-21T01:56:03Z</dc:date>
    </item>
  </channel>
</rss>

