<?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: Join type and extra data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489838#M136820</link>
    <description>&lt;P&gt;different year's &lt;CODE&gt;%m-%d&lt;/CODE&gt; values is populated. maybe &lt;EM&gt;2020/01/02 to 2020/01/09&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 01 May 2020 14:05:15 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-05-01T14:05:15Z</dc:date>
    <item>
      <title>Join type and extra data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489835#M136817</link>
      <description>&lt;P&gt;Here is my query (time range is YTD):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(splunk_server=indexer* index=wsi_tax_summary sourcetype=stash capability=109* tax_year=2019 ein=* intuit_offeringid=* 
partnerId!=*test* partnerId=*) 
| timechart span=1d dc(intuit_tid) as 19attempts 
| streamstats sum(19attempts) as 19attempts
| eval time=strftime(_time,"%m-%d") 
| join type=left time 
   [ inputlookup TY18_Splunk_total_data.csv 
    | where capability="109X" 
    | stats sum(attempts) as 18attempts by _time 
    | streamstats sum(18attempts) as 18attempts
    | eval time=strftime(strptime(_time,"%m/%d/%Y"), "%m-%d")
    | fields time 18attempts]
| fields time 19attempts 18attempts
| rename 19attempts as "TY19"
| rename 18attempts as "TY18"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I understand a left join to mean that if the results from my subsearch don't match with the main search, it won't be included. If I run the query above, I get data in TY18 column from 01-02 thru 01-09 (below).&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8818i4E79B7E7D48E7EA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I didn't expect data against those dates, so I copied the subsearch and ran it in a separate search window, and I can see (as I expected) there's no data from 01-02 thru 01-09 (below). &lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8819iE49F93089492082C/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Am I not understanding something about join type? What's happening here?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 22:37:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489835#M136817</guid>
      <dc:creator>hollybross1219</dc:creator>
      <dc:date>2020-04-30T22:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Join type and extra data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489836#M136818</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You should be able to get the same results without using join&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(splunk_server=indexer* index=wsi_tax_summary sourcetype=stash capability=109* tax_year=2019 ein=* intuit_offeringid=* 
    partnerId!=*test* partnerId=*) 
| timechart span=1d dc(intuit_tid) as 19attempts 
| streamstats sum(19attempts) as 19attempts 
| eval time=strftime(_time,"%m-%d") 
| append 
    [ inputlookup TY18_Splunk_total_data.csv 
    | where capability="109X" 
    | stats sum(attempts) as 18attempts by _time 
    | streamstats sum(18attempts) as 18attempts 
    | eval time=strftime(strptime(_time,"%m/%d/%Y"), "%m-%d") 
    | fields time 18attempts] 
| stats values(19attempts) AS TY19, values(18attempts) AS TY18 by time 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Cheers, Keith&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 00:12:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489836#M136818</guid>
      <dc:creator>kmugglet</dc:creator>
      <dc:date>2020-05-01T00:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Join type and extra data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489837#M136819</link>
      <description>&lt;P&gt;Also you should be able to replace this line &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ inputlookup TY18_Splunk_total_data.csv WHERE capability=="109X" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sometimes it works, sometimes it doesn't - Yay Splunk&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 00:20:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489837#M136819</guid>
      <dc:creator>kmugglet</dc:creator>
      <dc:date>2020-05-01T00:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Join type and extra data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489838#M136820</link>
      <description>&lt;P&gt;different year's &lt;CODE&gt;%m-%d&lt;/CODE&gt; values is populated. maybe &lt;EM&gt;2020/01/02 to 2020/01/09&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 14:05:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489838#M136820</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-01T14:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Join type and extra data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489839#M136821</link>
      <description>&lt;P&gt;Hi @kmugglet, thanks for the suggestion. I tried this and it didn't work :(. Join is what I'm looking for because I'm comparing days (represented by the row) across different years (represented by the two columns).  &lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 16:29:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489839#M136821</guid>
      <dc:creator>hollybross1219</dc:creator>
      <dc:date>2020-05-01T16:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Join type and extra data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489840#M136822</link>
      <description>&lt;P&gt;So I think it might be a problem with the data in the &lt;CODE&gt;lookup&lt;/CODE&gt;, but I don't understand what's wrong. When I do this basic query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup TY18_Splunk_total_data.csv 
| where capability="109X"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can see data against dates 1/2/2019 - 1/9/2019&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8816i41CC07F0A658A12B/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Aggregating this data, I lose the data against these dates for some reason, and I don't understand why. I ran this query which generated these results. I'm at a loss...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup TY18_Splunk_total_data.csv 
| where capability="109X"
| stats sum(attempts) by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8817i31EB36CF885E0319/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 16:34:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489840#M136822</guid>
      <dc:creator>hollybross1219</dc:creator>
      <dc:date>2020-05-01T16:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Join type and extra data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489841#M136823</link>
      <description>&lt;P&gt;| inputlookup TY18_Splunk_total_data.csv &lt;BR /&gt;
   | where capability="109X"&lt;BR /&gt;
   | stats sum(attempts) by _time&lt;BR /&gt;
   | sort 0 _time&lt;/P&gt;

&lt;P&gt;try and check the result.&lt;/P&gt;

&lt;P&gt;and when you use&lt;CODE&gt;streamstats&lt;/CODE&gt; , you should sort it.&lt;BR /&gt;
Splunk fields is ascii order(1,10,2,20 ... ) and result order same at sometime. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:17:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-type-and-extra-data/m-p/489841#M136823</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-09-30T05:17:17Z</dc:date>
    </item>
  </channel>
</rss>

