<?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: how to perform JOIN with STATS in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141201#M39087</link>
    <description>&lt;P&gt;Hi emiller,&lt;/P&gt;

&lt;P&gt;Providing earliest and latest with index ex. (index=A earliest=-1d@d latest=@d) OR (index=B) is not working for me.&lt;/P&gt;

&lt;P&gt;can you elaborate more on same.&lt;/P&gt;</description>
    <pubDate>Fri, 18 Jul 2014 06:02:31 GMT</pubDate>
    <dc:creator>khannasunil</dc:creator>
    <dc:date>2014-07-18T06:02:31Z</dc:date>
    <item>
      <title>how to perform JOIN with STATS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141192#M39078</link>
      <description>&lt;P&gt;Hi I am having two indexes&lt;BR /&gt;
INDEX_A &lt;BR /&gt;
with following fields : name,packets,sourceip&lt;BR /&gt;
and INDEX_B&lt;BR /&gt;
has following fields : category,classification,ipaddress&lt;/P&gt;

&lt;P&gt;In the above two indexes fields &lt;STRONG&gt;sourceip&lt;/STRONG&gt; and &lt;STRONG&gt;ipaddress&lt;/STRONG&gt; both contains the ipadresses(ex. 1.1.1.1 , 192.12.11.124 etc..) . So you can see here &lt;STRONG&gt;sourceip&lt;/STRONG&gt; and &lt;STRONG&gt;ipaddress&lt;/STRONG&gt; are the common fields .Now i want to perform join over these two indexes with the help of STATS not with JOIN because JOIN has performance issues.&lt;/P&gt;

&lt;P&gt;I'll  be very thankful if someone can provide the solution on same.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:03:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141192#M39078</guid>
      <dc:creator>khannasunil</dc:creator>
      <dc:date>2020-09-28T17:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to perform JOIN with STATS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141193#M39079</link>
      <description>&lt;P&gt;Hello Sunil,&lt;BR /&gt;
You can do by renaming the fields.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A OR index=B|rename ipaddress as sourceip|stats  avg(packets) by sourceip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|multisearch [search index=A|table name,packets,sourceip][search index=B | table category,classification,ipaddress|rename ipaddress as sourceip]|stats  avg(packets) by sourceip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
L&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2014 11:32:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141193#M39079</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-07-14T11:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to perform JOIN with STATS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141194#M39080</link>
      <description>&lt;P&gt;Thanks for your quick response linu.... but it does  not solve my problem ... let me elaborate this more ..&lt;/P&gt;

&lt;P&gt;The sourceIP has following values ex.&lt;BR /&gt;
1.1.1.1,12.12.11.1,123.211.1.1&lt;BR /&gt;
AND  ipaddress field has following value ex.&lt;BR /&gt;
1.1.1.1,191.121.121.1&lt;/P&gt;

&lt;P&gt;You can see above there is only one value "1.1.1.1" WHICH is common for both fields sourceip and ipaddress.&lt;BR /&gt;
I want result which gives me only this value not all(like natural join).&lt;/P&gt;

&lt;P&gt;How can i achieve this?? &lt;/P&gt;

&lt;P&gt;Waiting for your reply !!&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2014 12:49:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141194#M39080</guid>
      <dc:creator>khannasunil</dc:creator>
      <dc:date>2014-07-14T12:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to perform JOIN with STATS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141195#M39081</link>
      <description>&lt;P&gt;Basically do you want to know common IP Address among two sources or looking of other information as well?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2014 13:09:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141195#M39081</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-14T13:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to perform JOIN with STATS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141196#M39082</link>
      <description>&lt;P&gt;Here's how I would tackle this with stats.  (This assumes each ip address can only appear in each data set once)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A OR index=B | rename sourceip as ipaddress | stats count first(name) as name first(packets) as packets first(category) as category first(classification) as classification by ipaddress | where count&amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;where&lt;/CODE&gt; filter will omit anything which only shows up in both datasets. (You could also filter on a specific field being null, such as &lt;CODE&gt;|where isnull(category)&lt;/CODE&gt; for example.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2014 14:59:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141196#M39082</guid>
      <dc:creator>emiller42</dc:creator>
      <dc:date>2014-07-14T14:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to perform JOIN with STATS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141197#M39083</link>
      <description>&lt;P&gt;Thanks emiller.&lt;/P&gt;

&lt;P&gt;Query :: How can i handle two different time range in this search??&lt;/P&gt;

&lt;P&gt;Ex.&lt;BR /&gt;
I want to perform search on where index A result for last 24 hrs and index B for All time. How do i write earliest/latest two time here in this single search?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2014 16:59:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141197#M39083</guid>
      <dc:creator>khannasunil</dc:creator>
      <dc:date>2014-07-17T16:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to perform JOIN with STATS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141198#M39084</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;P&gt;|multisearch [search index=A earliest=-25h@h][search index=B] | ....rest of the search&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2014 17:29:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141198#M39084</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-17T17:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to perform JOIN with STATS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141199#M39085</link>
      <description>&lt;P&gt;Multisearch isn't necessary.  Just use simple boolean operators.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=A earliest=-1d@d latest=@d) OR (index=B) | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;modify earliest/latest requirements as needed.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2014 17:36:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141199#M39085</guid>
      <dc:creator>emiller42</dc:creator>
      <dc:date>2014-07-17T17:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to perform JOIN with STATS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141200#M39086</link>
      <description>&lt;P&gt;Somehow this didn't work for me earlier forcing me to use |multisearch. It works fine now. stumped...&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2014 18:48:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141200#M39086</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-17T18:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to perform JOIN with STATS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141201#M39087</link>
      <description>&lt;P&gt;Hi emiller,&lt;/P&gt;

&lt;P&gt;Providing earliest and latest with index ex. (index=A earliest=-1d@d latest=@d) OR (index=B) is not working for me.&lt;/P&gt;

&lt;P&gt;can you elaborate more on same.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jul 2014 06:02:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141201#M39087</guid>
      <dc:creator>khannasunil</dc:creator>
      <dc:date>2014-07-18T06:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to perform JOIN with STATS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141202#M39088</link>
      <description>&lt;P&gt;What is the timeframe of your search?  The section without an explicit earliest/latest will be bound by the timeframe you select in the UI.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jul 2014 22:15:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-perform-JOIN-with-STATS/m-p/141202#M39088</guid>
      <dc:creator>emiller42</dc:creator>
      <dc:date>2014-07-18T22:15:09Z</dc:date>
    </item>
  </channel>
</rss>

