<?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: Searching intersection of two subsets in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Searching-intersection-of-two-subsets/m-p/12748#M1069</link>
    <description>&lt;P&gt;There is a way to do this in Splunk using the &lt;CODE&gt;set&lt;/CODE&gt; commands ( &lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Set" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Set&lt;/A&gt; ) , but it is likely that there is a far more efficient way to do it without the &lt;CODE&gt;set&lt;/CODE&gt; command or a bunch of subsearches. (By filtering the data all at once, and then doing &lt;CODE&gt;... | top 5 by subsetname | stats count by commonfield&lt;/CODE&gt;, but whether this is possible depends on the specific conditions and the data). &lt;/P&gt;

&lt;P&gt;In general, it may be a good idea to give examples or describe what your incoming data is and what you want out, rather that specifying the specific algorithm, because a lot of set-based/table-based algorithms may be replaced with better algorithms that take better advantage of how Splunk processes data.&lt;/P&gt;</description>
    <pubDate>Mon, 03 May 2010 05:51:54 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2010-05-03T05:51:54Z</dc:date>
    <item>
      <title>Searching intersection of two subsets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-intersection-of-two-subsets/m-p/12747#M1068</link>
      <description>&lt;P&gt;Hello Splunkers,&lt;/P&gt;

&lt;P&gt;Thanks to visit my question.&lt;/P&gt;

&lt;P&gt;I have two subsets of data related to each other.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;The set A consists of 50 items. Of these, only top 5 items interests me
(subset AA'),assessed a condition.&lt;/LI&gt;
&lt;LI&gt;The set B contains 25 items. Of these, only top 5 items interests me
(subset BB'),assessed a condition.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;&lt;STRONG&gt;My goal is:&lt;/STRONG&gt;&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;search for the top 5 elements of AA ', once assessed a condition. &lt;/LI&gt;
&lt;LI&gt;search for the top 5 elements of B, once assessed a required condition.&lt;/LI&gt;
&lt;LI&gt;Count how many intersections have the elements of AA ' with each of the top 5 elements of BB'.&lt;/LI&gt;
&lt;LI&gt;(subsearch AA') AND (subsearch BB') &lt;STRONG&gt;gives different results if&lt;/STRONG&gt; (subsearch BB') AND (subsearch AA')&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Can someone kindly suggest me how to build that search using only the subsearches?&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;P&gt;Nik (currently working on splunk 4.0.9)&lt;/P&gt;</description>
      <pubDate>Sun, 02 May 2010 01:13:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-intersection-of-two-subsets/m-p/12747#M1068</guid>
      <dc:creator>nik_splunk</dc:creator>
      <dc:date>2010-05-02T01:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Searching intersection of two subsets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-intersection-of-two-subsets/m-p/12748#M1069</link>
      <description>&lt;P&gt;There is a way to do this in Splunk using the &lt;CODE&gt;set&lt;/CODE&gt; commands ( &lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Set" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Set&lt;/A&gt; ) , but it is likely that there is a far more efficient way to do it without the &lt;CODE&gt;set&lt;/CODE&gt; command or a bunch of subsearches. (By filtering the data all at once, and then doing &lt;CODE&gt;... | top 5 by subsetname | stats count by commonfield&lt;/CODE&gt;, but whether this is possible depends on the specific conditions and the data). &lt;/P&gt;

&lt;P&gt;In general, it may be a good idea to give examples or describe what your incoming data is and what you want out, rather that specifying the specific algorithm, because a lot of set-based/table-based algorithms may be replaced with better algorithms that take better advantage of how Splunk processes data.&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2010 05:51:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-intersection-of-two-subsets/m-p/12748#M1069</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-05-03T05:51:54Z</dc:date>
    </item>
  </channel>
</rss>

