<?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: Club two  different searches into one in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319349#M95478</link>
    <description>&lt;P&gt;Use &lt;CODE&gt;JOIN&lt;/CODE&gt; command Try below :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;first search giving result PlanNumber PlanType&amp;gt;|JOIN PlanNumber max=0 [second search giving result VendorId PlanNumber]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps you&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jan 2018 12:43:43 GMT</pubDate>
    <dc:creator>493669</dc:creator>
    <dc:date>2018-01-18T12:43:43Z</dc:date>
    <item>
      <title>Club two  different searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319347#M95476</link>
      <description>&lt;P&gt;I have one search which gives results like below:&lt;BR /&gt;
    PlanNumber  PlanType&lt;BR /&gt;
    123456           C&lt;BR /&gt;
    879879          R&lt;BR /&gt;
        567891           C&lt;/P&gt;

&lt;P&gt;2nd search gives results like this:&lt;BR /&gt;
VendorId    PlanNumber&lt;BR /&gt;&lt;BR /&gt;
ABCD            123456&lt;BR /&gt;&lt;BR /&gt;
AEFG            879879&lt;/P&gt;

&lt;P&gt;I want to combine the results and would like to display results as :&lt;BR /&gt;
VendorId    PlanNumber   PlanType&lt;BR /&gt;
ABCD            123456           C&lt;BR /&gt;
AEFG            879879           R&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Bhargav&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 10:25:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319347#M95476</guid>
      <dc:creator>bashtekar</dc:creator>
      <dc:date>2018-01-18T10:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Club two  different searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319348#M95477</link>
      <description>&lt;P&gt;hey try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;first search output in table&amp;gt; | join PlanNumber [search &amp;lt;2nd search output in table&amp;gt;]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Try this run anywhere search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval PlanNumber="123456C 879879R 567891C" 
| makemv PlanNumber 
| mvexpand PlanNumber 
| rex field=PlanNumber "(?P&amp;lt;PlanNumber&amp;gt;\d{6})(?P&amp;lt;PlanType&amp;gt;\w{1})" 
| fields - _time 
| join PlanNumber 
    [| makeresults 
    | eval VendorId="ABCD123456C AEFG879879R" 
    | makemv VendorId 
    | mvexpand VendorId 
    | rex field=VendorId "(?P&amp;lt;VendorId&amp;gt;\w{4})(?P&amp;lt;PlanNumber&amp;gt;\d{6})(?P&amp;lt;PlanType&amp;gt;\w{1})" 
    | fields - _time]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps !&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 12:42:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319348#M95477</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-18T12:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Club two  different searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319349#M95478</link>
      <description>&lt;P&gt;Use &lt;CODE&gt;JOIN&lt;/CODE&gt; command Try below :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;first search giving result PlanNumber PlanType&amp;gt;|JOIN PlanNumber max=0 [second search giving result VendorId PlanNumber]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps you&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 12:43:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319349#M95478</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-01-18T12:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Club two  different searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319350#M95479</link>
      <description>&lt;P&gt;The &lt;CODE&gt;join&lt;/CODE&gt; command will work, but is inefficient.  If you have a large data set you could get better performance using &lt;CODE&gt;stats&lt;/CODE&gt;.  We'd need to see your current queries to offer a new query that does not use join.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 13:03:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319350#M95479</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-01-18T13:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Club two  different searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319351#M95480</link>
      <description>&lt;P&gt;yes, but we need to know what is the index and data source of both the queries. @bashtekar if you give us search queries for both the searches it would be better for us to give you efficient solutions.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 13:08:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319351#M95480</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-18T13:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Club two  different searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319352#M95481</link>
      <description>&lt;P&gt;join is not working for me.. tried this. I am also trying something like join host instead of PlanNumber which is giving me partially incorrect result (its looping thorugh both searches and giving all possible results)&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 13:52:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319352#M95481</guid>
      <dc:creator>bashtekar</dc:creator>
      <dc:date>2018-01-18T13:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Club two  different searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319353#M95482</link>
      <description>&lt;P&gt;what is your search query?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 13:59:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319353#M95482</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-18T13:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Club two  different searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319354#M95483</link>
      <description>&lt;P&gt;Got solution used join host instead of join PlanNumber and gave separate names to both PlanNumbers &lt;BR /&gt;
and then by using eval removed plannumbers which were not matching and then deleted the rows&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 15:16:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319354#M95483</guid>
      <dc:creator>bashtekar</dc:creator>
      <dc:date>2018-01-18T15:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Club two  different searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319355#M95484</link>
      <description>&lt;P&gt;I agree with @richgalloway here - you should avoid using &lt;CODE&gt;join&lt;/CODE&gt; if you can help it. Without seeing your source searches, the general structure of what I'd recommend is this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your first search&amp;gt; OR &amp;lt;your second search&amp;gt;
| stats values(VendorId) AS VendorId values(PlanType) AS PlanType BY PlanNumber 
| fields VendorId PlanNumber PlanType
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In that first line, you will literally be joining the text of your first search with the second search. However, if the searches that are currently producing the first and second tables are complex, this won't work directly out of the box. So if you'd like help figuring out how to implement this structure, I'd be happy to help you analyze your queries. Feel free to obfuscate any sensitive data and post the search queries here.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 15:26:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319355#M95484</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-01-18T15:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Club two  different searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319356#M95485</link>
      <description>&lt;P&gt;If your problem is resolved, please accept an answer to help future users.&lt;BR /&gt;
It would help if you would share the query that solved your problem (mask private information).  SPL can be easier to understand than English.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 16:03:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Club-two-different-searches-into-one/m-p/319356#M95485</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-01-18T16:03:08Z</dc:date>
    </item>
  </channel>
</rss>

