<?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: Another Join Question - Searches With Matching sourcetype but Different index in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/532272#M150361</link>
    <description>&lt;P&gt;OK, so I figured out what was going on and I'd like to explain.&amp;nbsp; Then someone can correct me or tell me that I have a defective Splunk or something like that:&lt;/P&gt;&lt;P data-unlink="true"&gt;I was trying to make an ingestion metric by sourcetype. I know some of you will tell me that the metric is already provided by Splunk, but you do not know my environment. I work in Lehi, Utah and those metrics are collected and stored in Boise, Idaho (where I do not have the access to query).&amp;nbsp; However, the local indexers and heavy forwarders still have the sourcetype=splunkd,&amp;nbsp;&lt;SPAN class="t"&gt;group=per_sourcetype&lt;/SPAN&gt;&lt;SPAN&gt;_&lt;/SPAN&gt;&lt;SPAN class="t"&gt;thruput, and&lt;/SPAN&gt; source=/opt/splunk/var/log/splunk/metrics.log&amp;nbsp;.&amp;nbsp; These logs track ingestion by sourcetype and they track it on a fairly frequent nature, so I could actually perform timecharts and other reporting visualizations over time.&amp;nbsp;So, that was the background of what I was trying to accomplish.&lt;/P&gt;&lt;P data-unlink="true"&gt;In the past 15 minutes, for each sourcetype&amp;nbsp;this could give me possible events/records of anywhere from 1 to 500. So, I took this data and broke it out to give me columns of sourcetype as well as the other metrics (kbps, eps, kb, etc.). Keep in mind that a single sourcetype would appear in my table thousands of times depending on the time frame I pull.&lt;/P&gt;&lt;P data-unlink="true"&gt;Then I ran a simple query to return a unique table of sourcetype/index combinations (dedup).&amp;nbsp; Each index/sourcetype combo appeared in the table only once. On average, I got between 75 and 150 results in this table.&lt;/P&gt;&lt;P data-unlink="true"&gt;When I joined these two tables, the first 75-150 rows in the sourcetype data table gained an index value. The join NEVER went farther in the sourcetype table than the number of records I had in the sourcetype/index table. In my outrageously optomistic mind, I believed that each row in the sourcetype data table would be evaluated against the sourcetype/index table (the way a normal SQL join works - the sane way a join works).&amp;nbsp; The only way I could get this to work was to create a MASSIVE sourcetype/index table that had excessively more rows in it than the sourcetype/index table, so that each row could be evaluated.&amp;nbsp; But this added too much overhead to the search and I quickly gave up on the effort.&lt;/P&gt;&lt;P data-unlink="true"&gt;I have tested this many times in our environment and I get the same result over-and-over again, so no one can tell me this is not the way it works using the type of syntax I outlined in my original post. The site I work at is running the 7.3.3 version of Splunk Enterprise.&lt;/P&gt;&lt;P data-unlink="true"&gt;I appreciate responses from&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;and &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt;.&amp;nbsp; Both of you provided new ideas I had to go try and I did learn more from each experiment. Just wanted to send both of you a solid thank you for supporting me.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Dec 2020 02:49:57 GMT</pubDate>
    <dc:creator>ArchieCrozier</dc:creator>
    <dc:date>2020-12-08T02:49:57Z</dc:date>
    <item>
      <title>Another Join Question - Searches With Matching sourcetype but Different index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/514722#M144481</link>
      <description>&lt;P&gt;I have read through almost every Join label topic on the Splunk Community page and I don't seem to see one that fits my problem.&amp;nbsp; If there is one that works for this issue, please simply direct me to the correct discussion.&lt;/P&gt;&lt;P&gt;The closest discussion that looks like what I am shooting for is:&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-on-a-common-field-where-the-value-of/td-p/118222" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;How to join two searches on a common field where the value of the left search matches all values of the right search?&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp; But this discussion doesn't have a solution.&amp;nbsp;&amp;nbsp;And I've been through the &lt;A href="https://docs.splunk.com/Documentation" target="_blank" rel="noopener"&gt;docs.splunk.com&lt;/A&gt; pages reviewing the &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Search/Aboutsubsearches" target="_blank" rel="noopener"&gt;subsearch&lt;/A&gt;, &lt;A href="http://docs.splunk.com/Documentation/Splunk/8.0.5/SearchReference/Append" target="_blank" rel="noopener"&gt;append&lt;/A&gt;, &lt;A href="http://docs.splunk.com/Documentation/Splunk/8.0.5/SearchReference/Appendcols" target="_blank" rel="noopener"&gt;appendcols&lt;/A&gt;, &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.5/SearchReference/Join" target="_self"&gt;join&lt;/A&gt; and &lt;A href="http://docs.splunk.com/Documentation/Splunk/8.0.5/SearchReference/selfjoin" target="_blank" rel="noopener"&gt;selfjoin&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;The two searches I would like to join are:&lt;/P&gt;&lt;P&gt;Search 1:&lt;BR /&gt;&lt;SPAN&gt;index="_internal" source="*metrics.log" per_index_thruput series=autoshell host=lelsplunkix* | eval GB=kb/(1024*1024) | timechart span=12h sum(GB) as GB by series&lt;BR /&gt;&lt;/SPAN&gt;Results: (example - 500k+ rows returned)&lt;BR /&gt;_time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_raw&amp;nbsp; &amp;nbsp;sourcetype&amp;nbsp; &amp;nbsp; &amp;nbsp; GB&lt;BR /&gt;&lt;SPAN&gt;2020-08-18 07:04:33.307&amp;nbsp; &amp;nbsp; &amp;nbsp;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp;ship&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.0000264551490559&lt;BR /&gt;2020-08-18 07:04:31.168&amp;nbsp; &amp;nbsp; &amp;nbsp;LMN&amp;nbsp; &amp;nbsp; rum&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;0.0000000828877091&lt;BR /&gt;2020-08-18 07:04:24.174&amp;nbsp; &amp;nbsp; &amp;nbsp;XYZ&amp;nbsp; &amp;nbsp; &amp;nbsp;jacksparrow&amp;nbsp; &amp;nbsp; &amp;nbsp;0.0000000940635800&lt;BR /&gt;&lt;/SPAN&gt;IMPORTANT: The index of all of these is "&lt;SPAN&gt;_internal", not the actual index that the source data comes from.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Search 2:&lt;BR /&gt;| tstats count where (index=BlackPearl OR index=Tortuga OR index=Swashbuckler) by index, sourcetype | table sourcetype, index&lt;BR /&gt;Results: (example - roughly 86 rows returned)&lt;BR /&gt;sourcetype&amp;nbsp; &amp;nbsp; &amp;nbsp;index&lt;BR /&gt;ship&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BlackPearl&lt;BR /&gt;crew&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BlackPearl&lt;BR /&gt;rum&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Tortuga&lt;BR /&gt;wench&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Tortuga&lt;BR /&gt;willturner&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Swachbuckler&lt;BR /&gt;jacksparrow&amp;nbsp; Swashbuckler&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to join these results to make a single table of:&lt;BR /&gt;_time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_raw&amp;nbsp; &amp;nbsp;sourcetype&amp;nbsp; &amp;nbsp; &amp;nbsp; index&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GB&lt;BR /&gt;&lt;SPAN&gt;2020-08-18 07:04:33.307&amp;nbsp; &amp;nbsp; &amp;nbsp;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp;ship&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BlackPearl&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.0000264551490559&lt;BR /&gt;2020-08-18 07:04:31.168&amp;nbsp; &amp;nbsp; &amp;nbsp;LMN&amp;nbsp; &amp;nbsp; rum&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Tortuga&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.0000000828877091&lt;BR /&gt;2020-08-18 07:04:24.174&amp;nbsp; &amp;nbsp; &amp;nbsp;XYZ&amp;nbsp; &amp;nbsp; &amp;nbsp;jacksparrow&amp;nbsp; &amp;nbsp; &amp;nbsp;Swachbuckler&amp;nbsp; &amp;nbsp; &amp;nbsp;0.0000000940635800&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;I tried to use append and it just adds the additional sourcetype/index rows below the actual results (not as a new column).&amp;nbsp; I tried to use appendcols and the number of rows between the first search and the second search don't match, so only the first handful of rows get an index and the index doesn't match up with the sourcetype.&amp;nbsp; I tried to use join with the max=0 and type=inner and it only returned a handful of rows (less than 1000) and only for a few of the index/sourcetype combinations.&amp;nbsp; I even just tried to use the second search as a subsearch of the first search to limit the sourcetypes to ONLY the ones returned in the tstats search... which I think worked, but still didn't tell me which index applied to each sourcetype.&amp;nbsp; I can run the two separately, extract the data into excel and do a vlookup to get the results I want, but I need this to be in the report/search.&amp;nbsp; Help me!&amp;nbsp; I'm drowning.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Be gentle, this is my first discussion topic.&amp;nbsp; Hope this is enough information to clearly understand the problem.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 15:17:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/514722#M144481</guid>
      <dc:creator>ArchieCrozier</dc:creator>
      <dc:date>2020-08-18T15:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Another Join Question - Searches With Matching sourcetype but Different index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/514756#M144493</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I don’t really understand how you are getting sourcetype field from Your first search.&lt;BR /&gt;I am giving you spl to join based on the results you posted.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sourcetype field should be there in both search results.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index="_internal" source="*metrics.log" per_index_thruput series=autoshell host=lelsplunkix* | eval GB=kb/(1024*1024) | timechart span=12h sum(GB) as GB by series&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| join type=left sourcetype&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[| tstats count where (index=BlackPearl OR index=Tortuga OR index=Swashbuckler) by index, sourcetype | table sourcetype, index]&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 18:53:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/514756#M144493</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-18T18:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Another Join Question - Searches With Matching sourcetype but Different index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/514805#M144510</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;, You are 100% correct.&amp;nbsp; I screwed up (even after reading it so carefully).&amp;nbsp; The first search should have been this (need to watch what I copy/paste more carefully):&lt;/P&gt;&lt;P&gt;index=_internal source=*metrics.log group=per_sourcetype_thruput host=lelsplunkix* | rename series as sourcetype | eval GB=kb/(1024*1024) | table _time, _raw, sourcetype, GB&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 00:05:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/514805#M144510</guid>
      <dc:creator>ArchieCrozier</dc:creator>
      <dc:date>2020-08-19T00:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Another Join Question - Searches With Matching sourcetype but Different index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/514812#M144514</link>
      <description>&lt;P&gt;&lt;SPAN&gt;index=_internal source=*metrics.log group=per_sourcetype_thruput host=lelsplunkix* | rename series as sourcetype | eval GB=kb/(1024*1024) | table _time, _raw, sourcetype, GB&lt;BR /&gt;&lt;/SPAN&gt;| append [&lt;SPAN&gt;| tstats count where (index=BlackPearl OR index=Tortuga OR index=Swashbuckler) by index, sourcetype | table sourcetype, index]&lt;BR /&gt;| selfjoin sourcetype&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 00:31:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/514812#M144514</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-08-19T00:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Another Join Question - Searches With Matching sourcetype but Different index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/514815#M144516</link>
      <description>&lt;P&gt;Alright. Then you can replace first search in my previous answer with your new search and it should work.&lt;/P&gt;&lt;P&gt;if it solves your problem, thumbs up is really appreciated&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 02:31:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/514815#M144516</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-19T02:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Another Join Question - Searches With Matching sourcetype but Different index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/515071#M144591</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt;, I appreciate your responses, but neither of those methods work.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;, Your method gets me the closest, but I tried this same method before I submitted this help message ("&lt;SPAN&gt;I tried to use join with the max=0 and type=inner and it only returned a handful of rows and only for a few of the index/sourcetype combinations.&lt;/SPAN&gt;").&amp;nbsp; Using your "join type=left" search suggestion resulted in hundreds of sourcetypes I did not want because they were not part of the type=inner join that I was trying to achieve.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt;, Your solution returned only 5 rows (when it should have returned a minimum of 45,000 rows.&amp;nbsp; And it was also missing most of the index/sourcetype combinations.&lt;/P&gt;&lt;P&gt;Both options presented here give me at most 5 combinations of index/sourcetype in the results.&amp;nbsp; Neither one provides the full list I was trying to achieve.&lt;/P&gt;&lt;P&gt;I've simplified the search to try and make more sense out of this and drastically reduce the number of rows I am returning into the result set:&lt;/P&gt;&lt;P&gt;Search 1: (returns less than 500 rows)&lt;BR /&gt;&lt;SPAN&gt;index=_internal source=*metrics.log group=per_sourcetype_thruput earliest=-5d@d latest=-0d@d host=lelsplunki* | rename series as sourcetype | eval GB=kb/(1024*1024) | bucket _time span=1d | stats count by _time, sourcetype&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This returns&amp;nbsp;67 of sourcetypes I do not want.&amp;nbsp; I want only a set of sourcetypes that match my index types (~40 sourcetypes).&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE width="337"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="149px"&gt;_time&lt;/TD&gt;&lt;TD width="128px"&gt;sourcetype&lt;/TD&gt;&lt;TD width="59px"&gt;count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="149px"&gt;2020-08-14T00:00:00.000-0600&lt;/TD&gt;&lt;TD width="128px"&gt;ship&lt;/TD&gt;&lt;TD width="59px"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="149px"&gt;2020-08-14T00:00:00.000-0600&lt;/TD&gt;&lt;TD width="128px"&gt;rum&lt;/TD&gt;&lt;TD width="59px"&gt;583&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="149px"&gt;2020-08-14T00:00:00.000-0600&lt;/TD&gt;&lt;TD width="128px"&gt;jacksparrow&lt;/TD&gt;&lt;TD width="59px"&gt;623&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="149px"&gt;2020-08-14T00:00:00.000-0600&lt;/TD&gt;&lt;TD width="128px"&gt;crew&lt;/TD&gt;&lt;TD width="59px"&gt;38&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="149px"&gt;2020-08-14T00:00:00.000-0600&lt;/TD&gt;&lt;TD width="128px"&gt;splunkd&lt;/TD&gt;&lt;TD width="59px"&gt;11136&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="149px"&gt;2020-08-14T00:00:00.000-0600&lt;/TD&gt;&lt;TD width="128px"&gt;splunkd_access&lt;/TD&gt;&lt;TD width="59px"&gt;1278&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Charting this data with " | chart sum(GB) as TotGB by _time, sourcetype useother=false usenull=false limit=100" instead of the stats command&amp;nbsp;gives results like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE width="748"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="192"&gt;_time&lt;/TD&gt;&lt;TD width="84"&gt;ship&lt;/TD&gt;&lt;TD width="84"&gt;rum&lt;/TD&gt;&lt;TD width="117"&gt;jacksparrow&lt;/TD&gt;&lt;TD width="84"&gt;crew&lt;/TD&gt;&lt;TD width="84"&gt;splunkd&lt;/TD&gt;&lt;TD width="103"&gt;splunkd_access&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-08-14T00:00:00.000-0600&lt;/TD&gt;&lt;TD&gt;3.01609E-05&lt;/TD&gt;&lt;TD&gt;0.105190552&lt;/TD&gt;&lt;TD&gt;0.007976488&lt;/TD&gt;&lt;TD&gt;0.028933661&lt;/TD&gt;&lt;TD&gt;30.11121383&lt;/TD&gt;&lt;TD&gt;0.577985538&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-08-15T00:00:00.000-0600&lt;/TD&gt;&lt;TD&gt;2.77823E-05&lt;/TD&gt;&lt;TD&gt;0.08146602&lt;/TD&gt;&lt;TD&gt;9.0844E-05&lt;/TD&gt;&lt;TD&gt;0.032564973&lt;/TD&gt;&lt;TD&gt;29.98200507&lt;/TD&gt;&lt;TD&gt;0.536031151&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-08-16T00:00:00.000-0600&lt;/TD&gt;&lt;TD&gt;4.0628E-05&lt;/TD&gt;&lt;TD&gt;0.085774285&lt;/TD&gt;&lt;TD&gt;8.4443E-06&lt;/TD&gt;&lt;TD&gt;0.044780319&lt;/TD&gt;&lt;TD&gt;29.95757868&lt;/TD&gt;&lt;TD&gt;0.540789116&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-08-17T00:00:00.000-0600&lt;/TD&gt;&lt;TD&gt;3.3265E-05&lt;/TD&gt;&lt;TD&gt;0.105401807&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.042801711&lt;/TD&gt;&lt;TD&gt;29.97104058&lt;/TD&gt;&lt;TD&gt;0.515818447&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-08-18T00:00:00.000-0600&lt;/TD&gt;&lt;TD&gt;3.45539E-05&lt;/TD&gt;&lt;TD&gt;0.09992009&lt;/TD&gt;&lt;TD&gt;0.000168551&lt;/TD&gt;&lt;TD&gt;0.030914299&lt;/TD&gt;&lt;TD&gt;32.72855597&lt;/TD&gt;&lt;TD&gt;0.816412885&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;The index for all of these results is _internal, so I want to tie the sourcetype back to its actual index.&amp;nbsp; In my previous example I was using:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Search 2:&amp;nbsp;(returns less than 100 rows)&lt;BR /&gt;| tstats count where (index=BlackPearl OR index=Tortuga OR index=Swashbuckler) by index, sourcetype | table sourcetype, index&lt;BR /&gt;Results: (example - roughly 86 rows returned)&lt;BR /&gt;sourcetype&amp;nbsp; &amp;nbsp; &amp;nbsp;index&lt;BR /&gt;ship&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BlackPearl&lt;BR /&gt;crew&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BlackPearl&lt;BR /&gt;rum&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Tortuga&lt;BR /&gt;wench&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Tortuga&lt;BR /&gt;willturner&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Swachbuckler&lt;BR /&gt;jacksparrow&amp;nbsp; Swashbuckler&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Now that the data has been reduced from 500,000 events to the summary of the stats, I'm hoping that there is a way to join the two small result sets to make a single set of data that has the _time bucket, sourcetype, index, and Sum of the Total GB for each sourcetype over the time bucket window.&lt;/P&gt;&lt;P&gt;I'm going to try your solutions again with this new data set, but I don't know who flagged the reply provided by&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;as a solution... it simply does not work.&amp;nbsp; Sorry.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 23:02:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/515071#M144591</guid>
      <dc:creator>ArchieCrozier</dc:creator>
      <dc:date>2020-08-19T23:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Another Join Question - Searches With Matching sourcetype but Different index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/515073#M144593</link>
      <description>&lt;P&gt;OK, here is my last update, I just don't think Splunk is capable of doing a join they way I expect a join to work:&lt;/P&gt;&lt;P&gt;Search 1: (designed to get back all of the index/sourcetype combinations I care about, takes less than a second to run, returned back 85 rows, columns of index and sourcetype)&lt;BR /&gt;&lt;SPAN&gt;| tstats count where (index=BlackPearl OR index=Tortuga OR index=Swashbuckler) by index, sourcetype | table sourcetype, index&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Search 2: (designed to pull back the license usage by sourcetype from the Splunk internal metrics logs)&lt;BR /&gt;index=_internal source=*metrics.log group=per_sourcetype_thruput earliest=-5d@d latest=-0d@d host=lelsplunki* | rename series as sourcetype | eval GB=kb/(1024*1024) | bucket _time span=1d | stats sum(GB) as TotGB by _time, sourcetype, index&lt;/P&gt;&lt;P&gt;Ran search number 2 once for everything and got back 450 results.&amp;nbsp; Added "(series=crew OR series=jacksparrow)" to the base search to see how many should be returned and got back 169.&amp;nbsp; This is the 169 results I want back from this search.&lt;/P&gt;&lt;P&gt;Used both of the following searches to try the join option:&lt;/P&gt;&lt;P&gt;Search 3:&lt;BR /&gt;index=_internal source=*metrics.log group=per_sourcetype_thruput earliest=-5d@d latest=-0d@d host=lelsplunki* | rename series as sourcetype | eval GB=kb/(1024*1024) | bucket _time span=1d | join max=0 type=inner sourcetype [ | tstats count where &lt;SPAN&gt;(index=BlackPearl OR index=Tortuga OR index=Swashbuckler)&lt;/SPAN&gt; by index, sourcetype | table index, sourcetype ] | stats sum(GB) as TotGB by _time, sourcetype, index&lt;/P&gt;&lt;P&gt;Search 4:&lt;BR /&gt;index=_internal source=*metrics.log group=per_sourcetype_thruput earliest=-5d@d latest=-0d@d host=lelsplunki* | rename series as sourcetype | eval GB=kb/(1024*1024) | bucket _time span=1d | stats sum(GB) as TotGB by _time, sourcetype | join max=0 type=inner sourcetype [ | tstats count where &lt;SPAN&gt;(index=BlackPearl OR index=Tortuga OR index=Swashbuckler)&lt;/SPAN&gt; by index, sourcetype | table index, sourcetype ]&lt;/P&gt;&lt;P&gt;Both of those return only 16 rows and only ~5 combinations of index/sourcetype.&amp;nbsp; Append, appendcols has also been tried, but I am willing to try anything else you may suggest (even unique variations of append).&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 23:26:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/515073#M144593</guid>
      <dc:creator>ArchieCrozier</dc:creator>
      <dc:date>2020-08-19T23:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Another Join Question - Searches With Matching sourcetype but Different index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/532272#M150361</link>
      <description>&lt;P&gt;OK, so I figured out what was going on and I'd like to explain.&amp;nbsp; Then someone can correct me or tell me that I have a defective Splunk or something like that:&lt;/P&gt;&lt;P data-unlink="true"&gt;I was trying to make an ingestion metric by sourcetype. I know some of you will tell me that the metric is already provided by Splunk, but you do not know my environment. I work in Lehi, Utah and those metrics are collected and stored in Boise, Idaho (where I do not have the access to query).&amp;nbsp; However, the local indexers and heavy forwarders still have the sourcetype=splunkd,&amp;nbsp;&lt;SPAN class="t"&gt;group=per_sourcetype&lt;/SPAN&gt;&lt;SPAN&gt;_&lt;/SPAN&gt;&lt;SPAN class="t"&gt;thruput, and&lt;/SPAN&gt; source=/opt/splunk/var/log/splunk/metrics.log&amp;nbsp;.&amp;nbsp; These logs track ingestion by sourcetype and they track it on a fairly frequent nature, so I could actually perform timecharts and other reporting visualizations over time.&amp;nbsp;So, that was the background of what I was trying to accomplish.&lt;/P&gt;&lt;P data-unlink="true"&gt;In the past 15 minutes, for each sourcetype&amp;nbsp;this could give me possible events/records of anywhere from 1 to 500. So, I took this data and broke it out to give me columns of sourcetype as well as the other metrics (kbps, eps, kb, etc.). Keep in mind that a single sourcetype would appear in my table thousands of times depending on the time frame I pull.&lt;/P&gt;&lt;P data-unlink="true"&gt;Then I ran a simple query to return a unique table of sourcetype/index combinations (dedup).&amp;nbsp; Each index/sourcetype combo appeared in the table only once. On average, I got between 75 and 150 results in this table.&lt;/P&gt;&lt;P data-unlink="true"&gt;When I joined these two tables, the first 75-150 rows in the sourcetype data table gained an index value. The join NEVER went farther in the sourcetype table than the number of records I had in the sourcetype/index table. In my outrageously optomistic mind, I believed that each row in the sourcetype data table would be evaluated against the sourcetype/index table (the way a normal SQL join works - the sane way a join works).&amp;nbsp; The only way I could get this to work was to create a MASSIVE sourcetype/index table that had excessively more rows in it than the sourcetype/index table, so that each row could be evaluated.&amp;nbsp; But this added too much overhead to the search and I quickly gave up on the effort.&lt;/P&gt;&lt;P data-unlink="true"&gt;I have tested this many times in our environment and I get the same result over-and-over again, so no one can tell me this is not the way it works using the type of syntax I outlined in my original post. The site I work at is running the 7.3.3 version of Splunk Enterprise.&lt;/P&gt;&lt;P data-unlink="true"&gt;I appreciate responses from&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;and &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt;.&amp;nbsp; Both of you provided new ideas I had to go try and I did learn more from each experiment. Just wanted to send both of you a solid thank you for supporting me.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 02:49:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/532272#M150361</guid>
      <dc:creator>ArchieCrozier</dc:creator>
      <dc:date>2020-12-08T02:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Another Join Question - Searches With Matching sourcetype but Different index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/532289#M150368</link>
      <description>&lt;P&gt;Once, use &lt;STRONG&gt;outputcsv&lt;/STRONG&gt; or &lt;STRONG&gt;outputlookup&lt;/STRONG&gt; to create a table of sourcetypes,&lt;/P&gt;&lt;P&gt;and It is better to join them together with &lt;STRONG&gt;lookup&lt;/STRONG&gt;, I guess.&lt;/P&gt;&lt;P&gt;I think &lt;STRONG&gt;metadata&lt;/STRONG&gt; is the fastest way to find out which sourcetype is in the index.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 08:26:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Another-Join-Question-Searches-With-Matching-sourcetype-but/m-p/532289#M150368</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-12-08T08:26:06Z</dc:date>
    </item>
  </channel>
</rss>

