<?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 two columns in a table from two separate searches (where one is a subset of the other) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combine-two-columns-in-a-table-from-two-separate-searches-where/m-p/485569#M135848</link>
    <description>&lt;P&gt;@splunkuser2127 ,&lt;/P&gt;

&lt;P&gt;If the dog name is a common field in both searches , try below&lt;/P&gt;

&lt;P&gt;Let's say search1 includes index1 and search2 includes index2 &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=1 OR index=2 |stats values(dog_id) as dog_id , dc(index) as count by dogs_name
|where count &amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should give you the common records from both search&lt;/P&gt;

&lt;P&gt;Add additional field&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    index=1 OR index=2 |stats values(dog_id) as dog_id , dc(index) as count by dogs_name
    |where count &amp;gt;1
    |eval  is_golden_retriever=if(dogs_name=="Golden Retriever","True","False")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 04 May 2020 04:33:30 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2020-05-04T04:33:30Z</dc:date>
    <item>
      <title>Combine two columns in a table from two separate searches (where one is a subset of the other)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-two-columns-in-a-table-from-two-separate-searches-where/m-p/485568#M135847</link>
      <description>&lt;P&gt;I'm currently running the query (changed to a dog-themed query) where I want to join two logs together by the Dog's name and end up getting the dog's id:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search "something within logs" | join dog_name_field [search "Dogs Name: "]| table "dog_id"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want another column in the table, &lt;STRONG&gt;which is a subset of the results of the above search&lt;/STRONG&gt;, where I get a true or false on whether or not that id belongs to a Golden Retriever. To get the id's for the golden retrievers, I can do something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search "something within logs" | join dog_name_field[search "Dogs Name: " AND "Golden Retriever"]| table "dog_id"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I get the ids of all the dogs and have another column saying whether or not that dogs is a golden retriever efficiently.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 14:50:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-two-columns-in-a-table-from-two-separate-searches-where/m-p/485568#M135847</guid>
      <dc:creator>splunkuser2127</dc:creator>
      <dc:date>2020-05-01T14:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two columns in a table from two separate searches (where one is a subset of the other)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-two-columns-in-a-table-from-two-separate-searches-where/m-p/485569#M135848</link>
      <description>&lt;P&gt;@splunkuser2127 ,&lt;/P&gt;

&lt;P&gt;If the dog name is a common field in both searches , try below&lt;/P&gt;

&lt;P&gt;Let's say search1 includes index1 and search2 includes index2 &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=1 OR index=2 |stats values(dog_id) as dog_id , dc(index) as count by dogs_name
|where count &amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should give you the common records from both search&lt;/P&gt;

&lt;P&gt;Add additional field&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    index=1 OR index=2 |stats values(dog_id) as dog_id , dc(index) as count by dogs_name
    |where count &amp;gt;1
    |eval  is_golden_retriever=if(dogs_name=="Golden Retriever","True","False")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 May 2020 04:33:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-two-columns-in-a-table-from-two-separate-searches-where/m-p/485569#M135848</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-05-04T04:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two columns in a table from two separate searches (where one is a subset of the other)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-two-columns-in-a-table-from-two-separate-searches-where/m-p/485570#M135849</link>
      <description>&lt;P&gt;This is helpful, but the dog_name can't be golden retriever, the word "Golden retriever" just might be found in the second search's log&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 14:34:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-two-columns-in-a-table-from-two-separate-searches-where/m-p/485570#M135849</guid>
      <dc:creator>splunkuser2127</dc:creator>
      <dc:date>2020-05-04T14:34:13Z</dc:date>
    </item>
  </channel>
</rss>

