<?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 would I be able to improve the following joined query? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-be-able-to-improve-the-following-joined-query/m-p/579399#M201899</link>
    <description>&lt;P&gt;The first step in the query is to count all events and list the unique values of field 'd' for all usernames in old_index.&amp;nbsp; The second step is to count all events for each username in new_index.&amp;nbsp; Finally, the two sets of results are merged based on common username values.&amp;nbsp; If there is no match, the count from new_index is retained.&lt;/P&gt;&lt;P&gt;Here's one alternative query that should be more efficient.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=old_index
| stats count as old_count values(d) as d by username 
| append [search index=new_index | stats count as new_count by username ]
| stats values(*) as * by username&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 28 Dec 2021 15:32:11 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2021-12-28T15:32:11Z</dc:date>
    <item>
      <title>How would I be able to improve the following joined query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-be-able-to-improve-the-following-joined-query/m-p/579389#M201894</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Learning about joins and sub searches. What's the following query executing and would there be a way to make it more efficient?&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;index=old_indexstats count values(d) as d by username | join type=inner username [search index=new_index | stats count by username ]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I believe it starts by searching and counting usernames in the new index however, am getting mixed up after that.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 14:44:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-would-I-be-able-to-improve-the-following-joined-query/m-p/579389#M201894</guid>
      <dc:creator>brc55</dc:creator>
      <dc:date>2021-12-28T14:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: How would I be able to improve the following joined query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-would-I-be-able-to-improve-the-following-joined-query/m-p/579399#M201899</link>
      <description>&lt;P&gt;The first step in the query is to count all events and list the unique values of field 'd' for all usernames in old_index.&amp;nbsp; The second step is to count all events for each username in new_index.&amp;nbsp; Finally, the two sets of results are merged based on common username values.&amp;nbsp; If there is no match, the count from new_index is retained.&lt;/P&gt;&lt;P&gt;Here's one alternative query that should be more efficient.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=old_index
| stats count as old_count values(d) as d by username 
| append [search index=new_index | stats count as new_count by username ]
| stats values(*) as * by username&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 28 Dec 2021 15:32:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-would-I-be-able-to-improve-the-following-joined-query/m-p/579399#M201899</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-12-28T15:32:11Z</dc:date>
    </item>
  </channel>
</rss>

