<?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: Use result of set intersect for another command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Use-result-of-set-intersect-for-another-command/m-p/443892#M125896</link>
    <description>&lt;P&gt;Hi @catalinberbece,&lt;/P&gt;

&lt;P&gt;Try this,&lt;BR /&gt;
EDITED as per the new requirement.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=A OR index=B) |rename IP_ADDRESS as clientIP |stats dc(index) as dcIndex, values(Description) as Description by clientIP|where dcIndex &amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 13 Jul 2018 14:01:36 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2018-07-13T14:01:36Z</dc:date>
    <item>
      <title>Use result of set intersect for another command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-result-of-set-intersect-for-another-command/m-p/443890#M125894</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am trying to use the result of an intersect to further search in one of the indexes.&lt;BR /&gt;
| set intersect&lt;BR /&gt;
[search index=A something...&lt;BR /&gt;
|table IP]&lt;BR /&gt;
[search index=B something...&lt;BR /&gt;
| table IP]&lt;BR /&gt;
///at this point I have a table of common IPs between the two indexes. Now I want to add to that table another field which is only present in the index=B, so the final result will look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IP                      Description
x.x.x.x                  something1
y.y.y.y                  something2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Both IP and Description are extracted fields.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 13:34:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-result-of-set-intersect-for-another-command/m-p/443890#M125894</guid>
      <dc:creator>catalinberbece</dc:creator>
      <dc:date>2018-07-13T13:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Use result of set intersect for another command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-result-of-set-intersect-for-another-command/m-p/443891#M125895</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=B [search index=A something...
|table IP]
|  table IP Description
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Jul 2018 13:57:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-result-of-set-intersect-for-another-command/m-p/443891#M125895</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-07-13T13:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Use result of set intersect for another command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-result-of-set-intersect-for-another-command/m-p/443892#M125896</link>
      <description>&lt;P&gt;Hi @catalinberbece,&lt;/P&gt;

&lt;P&gt;Try this,&lt;BR /&gt;
EDITED as per the new requirement.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=A OR index=B) |rename IP_ADDRESS as clientIP |stats dc(index) as dcIndex, values(Description) as Description by clientIP|where dcIndex &amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Jul 2018 14:01:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-result-of-set-intersect-for-another-command/m-p/443892#M125896</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-07-13T14:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Use result of set intersect for another command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-result-of-set-intersect-for-another-command/m-p/443893#M125897</link>
      <description>&lt;P&gt;I've just tried both solutions but neither works. I want to mention that for one index the IP is named "clientIP" while for the other index is named "IP_ADDRESS". Also, the description field is present only on the index where IP is named "clientIP".&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 14:28:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-result-of-set-intersect-for-another-command/m-p/443893#M125897</guid>
      <dc:creator>catalinberbece</dc:creator>
      <dc:date>2018-07-13T14:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Use result of set intersect for another command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-result-of-set-intersect-for-another-command/m-p/443894#M125898</link>
      <description>&lt;P&gt;Updated the answer, please try and lets know&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jul 2018 04:00:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-result-of-set-intersect-for-another-command/m-p/443894#M125898</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-07-14T04:00:33Z</dc:date>
    </item>
  </channel>
</rss>

