<?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 table outer search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23339#M4160</link>
    <description>&lt;P&gt;Does the current_summary rain value change by time?  If so, you'll need to preserve that in your subsearch as well--bucket _time by the same range you use in the outer search and join on that as well as current_area.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 14:29:40 GMT</pubDate>
    <dc:creator>cphair</dc:creator>
    <dc:date>2020-09-28T14:29:40Z</dc:date>
    <item>
      <title>join table outer search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23334#M4155</link>
      <description>&lt;P&gt;Hi all, I need to join two table up and do a count of rain. Below is my search query is there anything wrong ? I can't seems to display my count of rain over places.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;CODE&gt;sourcetype="ltaTraffic" OR sourcetype="CurrentWeatherSGMap" Type="Accident" Location="AYE" OR Location="BKE" OR Location="CTE" OR Location="KJE" OR Location="PIE" OR Location="SLE" OR Location="TPE" OR Location="ECP" earliest=-7d latest=now | &lt;BR /&gt;
transaction locationaccident maxspan=5s  | &lt;BR /&gt;
bucket span=1h _time | &lt;BR /&gt;
dedup locationaccident  | &lt;BR /&gt;
fields onexpressway, locationaccident, current_area | &lt;BR /&gt;
join current_area [search sourcetype="CurrentWeatherSGMap"  | &lt;BR /&gt;
rename Message as current_area | fields current_area current_summary] | &lt;BR /&gt;
stats list(locationaccident) as Accidents, count(eval(current_summary="Rain" OR current_summary="Thundery Showers" OR current_summary="Showers" OR current_summary="Passing Showers" OR current_summary="Heavy Thundery Showers")) as Rain by onexpressway _time&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://splunk-base.splunk.com//storage/Untitled_22.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;I have updated the query to this (filter in the subsearch), but it return the exact same count values as the accident count. What is wrong with the query ? I changed it to a timechart.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;CODE&gt;sourcetype="ltaTraffic" OR sourcetype="CurrentWeatherSGMap" Type="Accident" Location="AYE" OR Location="BKE" OR Location="CTE" OR Location="ECP" OR Location="KJE" OR Location="PIE" OR Location="SLE" OR Location="TPE"  earliest=-7d latest=now | transaction locationaccident maxspan=20s  | bucket span=1m _time | dedup _time  | fields onexpressway, locationaccident, current_area | join current_area [search sourcetype="CurrentWeatherSGMap" current_summary="Rain" OR current_summary="Thundery Showers" OR current_summary="Showers" OR current_summary="Passing Showers" OR current_summary="Heavy Thundery Showers" | rename Message as current_area | fields current_area current_summary] | timechart count(locationaccident) as Accidents, count(current_summary) as Rain by onexpressway&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://splunk-base.splunk.com//storage/Untitled_23.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;I have tried this outer search but it wont work:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;CODE&gt;sourcetype="ltaTraffic"  Type="Accident" Location="AYE" OR Location="BKE" OR Location="CTE" OR Location="ECP" OR Location="KJE" OR Location="PIE" OR Location="SLE" OR Location="TPE"  earliest=-7d latest=now | transaction locationaccident maxspan=20s  | bucket span=1h _time | dedup locationaccident  | fields onexpressway, locationaccident, current_area | join type=outer current_area [search sourcetype="CurrentWeatherSGMap" current_summary="Rain" OR current_summary="Thundery Showers" OR current_summary="Showers" OR current_summary="Passing Showers" OR current_summary="Heavy Thundery Showers" | rename Message as current_area | fields current_area current_summary] | timechart span=1d count(locationaccident) as Accidents, list(current_summary) as Rain by onexpressway&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://splunk-base.splunk.com//storage/Untitled_26.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2013 12:52:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23334#M4155</guid>
      <dc:creator>kailun92</dc:creator>
      <dc:date>2013-08-02T12:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: join table outer search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23335#M4156</link>
      <description>&lt;P&gt;I think it's because of the assignment in count for the STATS. Filter the values before you count rather than in the count function, you should have the result. Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2013 13:52:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23335#M4156</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2013-08-02T13:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: join table outer search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23336#M4157</link>
      <description>&lt;P&gt;I filter the results in the subsearch, the data came out but it is exactly the same as the accidents count. I cannot find other error in the search query. Will continue doing that.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2013 14:34:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23336#M4157</guid>
      <dc:creator>kailun92</dc:creator>
      <dc:date>2013-08-02T14:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: join table outer search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23337#M4158</link>
      <description>&lt;P&gt;The second search isn't working because you're not joining any events with non-rain current_summary values; non-rain locations are discarded.  Every event in the subsearch has a current_summary field, and if every event in the main search has a locationaccident field (no matter what the value is), then the two counts will be the same.  One way to fix this is to modify the join command with the parameter type=outer--that will preserve the main search results that do not have a rain value in current_summary and leave the current_summary field null, so you should then see the correct counts, assuming there's not already a current_summary field in your base search.&lt;/P&gt;

&lt;P&gt;Also, I'm not sure what your source data looks like, but it looks odd to search for the CurrentWeatherSGMap sourcetype in the base search and then seemingly not using it until the subsearch.  Either you don't need it in the base search, or it's likely you can get away without using a subsearch, which is a big performance hit.  I'd have to see a sample event from both sourcetypes to say for sure.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:29:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23337#M4158</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2020-09-28T14:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: join table outer search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23338#M4159</link>
      <description>&lt;P&gt;I have tried join type=outer, it didn't change anything. Am I using it the wrong way ? Do I have to put a where clause to define the null value ?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2013 16:03:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23338#M4159</guid>
      <dc:creator>kailun92</dc:creator>
      <dc:date>2013-08-02T16:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: join table outer search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23339#M4160</link>
      <description>&lt;P&gt;Does the current_summary rain value change by time?  If so, you'll need to preserve that in your subsearch as well--bucket _time by the same range you use in the outer search and join on that as well as current_area.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:29:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23339#M4160</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2020-09-28T14:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: join table outer search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23340#M4161</link>
      <description>&lt;P&gt;Didn't know subsearch search for time as well as join. Thank you so much !!!&lt;/P&gt;</description>
      <pubDate>Sat, 03 Aug 2013 17:43:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-table-outer-search/m-p/23340#M4161</guid>
      <dc:creator>kailun92</dc:creator>
      <dc:date>2013-08-03T17:43:19Z</dc:date>
    </item>
  </channel>
</rss>

