<?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: looking for 'faster' way to join to indexes (still) in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626674#M11772</link>
    <description>&lt;P&gt;There is some documentation on subsearches&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Search/Aboutsubsearches" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Search/Aboutsubsearches&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and also, some documentation on how to format the output of a subsearch for some more 'interesting' requirements&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Search/Changetheformatofsubsearchresults" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Search/Changetheformatofsubsearchresults&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and details on the all important 'format' command&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Format" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Format&lt;/A&gt;&lt;/P&gt;&lt;P&gt;When working out what the output from a subsearch looks like, you can run the subsearch on it's own and tag&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| format&lt;/LI-CODE&gt;&lt;P&gt;to the end and you cam what will be passed to the outer. So, you can run&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" resource="somefilter" column="terminated"
  | stats count by guid
  | fields guid
  | format&lt;/LI-CODE&gt;&lt;P&gt;to see how your subsearch will work.&lt;/P&gt;&lt;P&gt;NOTE: subsearches are run BEFORE the outer search in almost all cases and they are not a solution to all problems. There are limitations to subsearch result sets, by default 10,000 results and 60 seconds runtime.&lt;/P&gt;&lt;P&gt;Imagine adding (guid=1 OR guid=2 OR ... guid=10000) to the outer search. That can sometimes slow down the outer search, so use them wisely.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jan 2023 23:10:25 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-01-10T23:10:25Z</dc:date>
    <item>
      <title>Is there a 'faster' way to join to indexes ?</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626475#M11762</link>
      <description>&lt;P&gt;splunk receives 2 different stream data sets on a single hec (json).&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;set 1 has call records&lt;/LI&gt;
&lt;LI&gt;set 2 has call status/disposition&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;so if i want call detail information from set 1 on calls that meet criteria in set 2, i have to join the records.&lt;/P&gt;
&lt;P&gt;i used to use 'join' but read several articles about other ways and came across this method which I like, but really feels so slow/heavy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="myindex" resource="somefilter"
| stats values(*) as * by guid
| search column="terminated"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;because we have millions of rows to search from and i'm just looking for a few.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I tried adding my search criteria higher up, like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="myindex" resource="somefilter" column="terminated"
| stats values(*) as * by guid&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;but then the other columns come back empty (I presume because it filtered them out, so nothing to join).&lt;BR /&gt;&lt;BR /&gt;So looking for another/faster/better way to:&lt;BR /&gt;1. get data from set 2 with criteria X&lt;BR /&gt;2. bring back matches of that data from set 1.&lt;BR /&gt;&lt;BR /&gt;Always many thanks for the education!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 19:23:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626475#M11762</guid>
      <dc:creator>loganseth</dc:creator>
      <dc:date>2023-01-10T19:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: looking for 'faster' way to join to indexes (still)</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626477#M11763</link>
      <description>&lt;P&gt;Hard to say with such imprecise description &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But if you're looking for just a few guids, it might be one of those cases when subsearch makes sense.&lt;/P&gt;&lt;P&gt;Otherwise you might look into one of three methods of making your searches faster - &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/Knowledge/Aboutsummaryindexing#Comparing_summary-based_search_acceleration_methods" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/Knowledge/Aboutsummaryindexing#Comparing_summary-based_search_acceleration_methods&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 21:34:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626477#M11763</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-01-09T21:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: looking for 'faster' way to join to indexes (still)</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626489#M11764</link>
      <description>&lt;P&gt;yea, for sure was trying to provide detail, but rip.&lt;BR /&gt;&lt;BR /&gt;ok, what does "one of those cases when subsearch makes sense" mean?&lt;BR /&gt;&lt;BR /&gt;like, "one of those cases when subsearch makes sense...to use join or append" or something?&lt;/P&gt;&lt;P&gt;ty!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 22:35:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626489#M11764</guid>
      <dc:creator>loganseth</dc:creator>
      <dc:date>2023-01-09T22:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: looking for 'faster' way to join to indexes (still)</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626491#M11765</link>
      <description>&lt;P&gt;No. I mean that you use a subsearch to generate a set of conditions which will later apply to the main search.&lt;/P&gt;&lt;P&gt;Join is bad for different reasons but subsearches are usually also best avoided. But there are sometimes use cases when they can be reasonably used.&lt;/P&gt;&lt;P&gt;See &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Search/Aboutsubsearches" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Search/Aboutsubsearches&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 23:08:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626491#M11765</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-01-09T23:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: looking for 'faster' way to join to indexes (still)</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626493#M11766</link>
      <description>&lt;P&gt;gotcha.&amp;nbsp; yes, i'm working on 'avoiding' join for sure, and thought that stats values(*) thing was here to save me, but it's really intensive, still, too, for this particular data set.&lt;/P&gt;&lt;P&gt;for this particular search, i have some set of data in that index i want, which is like 200 rows.&lt;/P&gt;&lt;P&gt;so i just created a report for the 200 and sent to a lookup&lt;/P&gt;&lt;P&gt;then created&amp;nbsp; a new report and used the other data search and | lookup and while it's substantially faster.&lt;/P&gt;&lt;P&gt;that is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats values(*) as * by id&lt;/LI-CODE&gt;&lt;P&gt;took 1600 seconds&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| index="mystuff"
| lookup filename.csv id OUTPUT col1 col2&lt;/LI-CODE&gt;&lt;P&gt;took about 180s.&lt;/P&gt;&lt;P&gt;again, where I 'filtered down' the things i wanted to match by saving them into filename.csv first.&lt;/P&gt;&lt;P&gt;i mean, is that a hack? idk.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;appreciate your wisdom always, sir.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 23:39:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626493#M11766</guid>
      <dc:creator>loganseth</dc:creator>
      <dc:date>2023-01-09T23:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: looking for 'faster' way to join to indexes (still)</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626494#M11767</link>
      <description>&lt;P&gt;The subsearch&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;talks about would look something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" resource="somefilter" [ 
  search index="myindex" resource="somefilter" column="terminated"
  | stats count by guid
  | fields guid ]
| stats values(*) as * by guid&lt;/LI-CODE&gt;&lt;P&gt;so your subsearch is creating the list of guids that are terminated and then passing that list as guid constraints to the outer search by effectively adding (guid=A OR guid=B OR guid=C...) to the outer search.&lt;/P&gt;&lt;P&gt;Make your subsearch as concise as possible, i.e. use as many filter criteria as you can (sourcetype etc) to only select the call status records you want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 00:23:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626494#M11767</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-01-10T00:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: looking for 'faster' way to join to indexes (still)</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626656#M11771</link>
      <description>&lt;P&gt;HOLY SPLUNK BUCKETS, BATMAN!&lt;BR /&gt;&lt;BR /&gt;This ran REALLY WELL.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have never read/heard anyone explain it like that:&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;"effectively adding (guid=A OR guid=B OR guid=C...) to the outer search."&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;do you have any links where I can read more?&lt;BR /&gt;&lt;BR /&gt;The explanation sounds like an inner SQL statement (which I'm most familiar with), like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT something
FROM somewhere
WHERE (
SELECT guid FROM somewhereelse WHERE status="terminated"
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Seriously, this is fantastic.&amp;nbsp; Days of google searches explained in a simple example.&lt;BR /&gt;&lt;BR /&gt;Legends you guys.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 19:35:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626656#M11771</guid>
      <dc:creator>loganseth</dc:creator>
      <dc:date>2023-01-10T19:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: looking for 'faster' way to join to indexes (still)</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626674#M11772</link>
      <description>&lt;P&gt;There is some documentation on subsearches&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Search/Aboutsubsearches" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Search/Aboutsubsearches&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and also, some documentation on how to format the output of a subsearch for some more 'interesting' requirements&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Search/Changetheformatofsubsearchresults" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Search/Changetheformatofsubsearchresults&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and details on the all important 'format' command&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Format" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Format&lt;/A&gt;&lt;/P&gt;&lt;P&gt;When working out what the output from a subsearch looks like, you can run the subsearch on it's own and tag&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| format&lt;/LI-CODE&gt;&lt;P&gt;to the end and you cam what will be passed to the outer. So, you can run&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" resource="somefilter" column="terminated"
  | stats count by guid
  | fields guid
  | format&lt;/LI-CODE&gt;&lt;P&gt;to see how your subsearch will work.&lt;/P&gt;&lt;P&gt;NOTE: subsearches are run BEFORE the outer search in almost all cases and they are not a solution to all problems. There are limitations to subsearch result sets, by default 10,000 results and 60 seconds runtime.&lt;/P&gt;&lt;P&gt;Imagine adding (guid=1 OR guid=2 OR ... guid=10000) to the outer search. That can sometimes slow down the outer search, so use them wisely.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 23:10:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626674#M11772</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-01-10T23:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: looking for 'faster' way to join to indexes (still)</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626682#M11774</link>
      <description>&lt;P&gt;Also remember that even while you might get your subsearch well within the 10k events limit, running a search with several thousand conditions might not be the best idea.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 00:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626682#M11774</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-01-11T00:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: looking for 'faster' way to join to indexes (still)</title>
      <link>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626820#M11777</link>
      <description>&lt;P&gt;Got it.&amp;nbsp; So limit criteria to 999 conditions. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 16:56:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Is-there-a-faster-way-to-join-to-indexes/m-p/626820#M11777</guid>
      <dc:creator>loganseth</dc:creator>
      <dc:date>2023-01-11T16:56:21Z</dc:date>
    </item>
  </channel>
</rss>

