<?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 do RIGHT OUTER JOIN with Lookup table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-RIGHT-OUTER-JOIN-with-Lookup-table/m-p/507726#M141931</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/171870"&gt;@pm771&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;One of the approaches is&lt;/P&gt;&lt;P&gt;Assuming you have a lookup "ID" with set of "ids"&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|inputlookup ID|eval count=0, source="lookup"
|append [search index="your index" | stats count by ids|eval source="events" ]
|stats sum(count) as count,values(source) as source by ids&lt;/LI-CODE&gt;&lt;P&gt;Source is added to distinguish between the sources , you may remove it&lt;/P&gt;&lt;P&gt;If the result looks good, we shall further filter it by using the source&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jul 2020 02:32:55 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2020-07-07T02:32:55Z</dc:date>
    <item>
      <title>How to do RIGHT OUTER JOIN with Lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-RIGHT-OUTER-JOIN-with-Lookup-table/m-p/507722#M141927</link>
      <description>&lt;P&gt;Events stream has ID field in every record.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;There is a lookup table with a small subset of IDs.&lt;BR /&gt;&lt;BR /&gt;The task is to calculate the total number of occurrences for each ID from the lookup table for every 15 min.&lt;BR /&gt;&lt;BR /&gt;It is possible that certain IDs from the table will not be found.&amp;nbsp; In such cases they should still be included in the result with the count of zero.&lt;BR /&gt;&lt;BR /&gt;SQL version:&lt;BR /&gt;&lt;BR /&gt;SELECT ID, COUNT(ID)&amp;nbsp;&amp;nbsp;&lt;BR /&gt;FROM Events e&lt;BR /&gt;RIGHT JOIN Lookup l ON l.ID=e.ID&lt;BR /&gt;GROUP BY I.ID&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;What would be a good Splunk way to achieve the same?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 01:14:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-RIGHT-OUTER-JOIN-with-Lookup-table/m-p/507722#M141927</guid>
      <dc:creator>pm771</dc:creator>
      <dc:date>2020-07-07T01:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to do RIGHT OUTER JOIN with Lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-RIGHT-OUTER-JOIN-with-Lookup-table/m-p/507726#M141931</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/171870"&gt;@pm771&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;One of the approaches is&lt;/P&gt;&lt;P&gt;Assuming you have a lookup "ID" with set of "ids"&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|inputlookup ID|eval count=0, source="lookup"
|append [search index="your index" | stats count by ids|eval source="events" ]
|stats sum(count) as count,values(source) as source by ids&lt;/LI-CODE&gt;&lt;P&gt;Source is added to distinguish between the sources , you may remove it&lt;/P&gt;&lt;P&gt;If the result looks good, we shall further filter it by using the source&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 02:32:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-RIGHT-OUTER-JOIN-with-Lookup-table/m-p/507726#M141931</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-07-07T02:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to do RIGHT OUTER JOIN with Lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-RIGHT-OUTER-JOIN-with-Lookup-table/m-p/507838#M141959</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/136781"&gt;@renjith_nair&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you very much for your reply.&lt;BR /&gt;&lt;BR /&gt;I was considering&amp;nbsp; an`append` approach but did not come with `count()` and `sum()` combination.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 13:24:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-RIGHT-OUTER-JOIN-with-Lookup-table/m-p/507838#M141959</guid>
      <dc:creator>pm771</dc:creator>
      <dc:date>2020-07-07T13:24:37Z</dc:date>
    </item>
  </channel>
</rss>

