<?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: help on lost event with join command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-on-lost-event-with-join-command/m-p/482046#M142989</link>
    <description>&lt;P&gt;hi,&lt;/P&gt;

&lt;P&gt;Let me explain the working of &lt;CODE&gt;join&lt;/CODE&gt; command.&lt;BR /&gt;
Let's call, search query before &lt;CODE&gt;join&lt;/CODE&gt; as main-search and the other as sub-search.&lt;/P&gt;

&lt;P&gt;As your query is missing some events, the possibilities are,&lt;BR /&gt;
- In case of outer join, the result will include all the events from main-search and only matching events from sub-search. Now if the field used with join command is not available in sub-search, those events will not be available.&lt;BR /&gt;
- There limit on results returned by sub-search. While using &lt;CODE&gt;join&lt;/CODE&gt; command, the sub-search will only return 50,000 events. In you case, you are searching for 30 days span, so may be the sub-search event out is greater than 50,000.&lt;/P&gt;

&lt;P&gt;For more details you can refer to - &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Join"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Join&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;accept and up-vote the answer if it helps.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Mar 2020 09:39:20 GMT</pubDate>
    <dc:creator>gaurav_maniar</dc:creator>
    <dc:date>2020-03-04T09:39:20Z</dc:date>
    <item>
      <title>help on lost event with join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-lost-event-with-join-command/m-p/482045#M142988</link>
      <description>&lt;P&gt;hello&lt;BR /&gt;I use the search below in order to monitore the last reboot and the last logon date&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;`LastLogonBoot` 
| eval SystemTime=strptime(SystemTime, "'%Y-%m-%dT%H:%M:%S.%9Q%Z'") 
| stats latest(SystemTime) as SystemTime by host EventCode 
| xyseries host EventCode SystemTime 
| rename "6005" as LastLogon "6006" as LastReboot 
| eval NbDaysLogon=round((now() - LastLogon)/(3600*24), 0) 
| eval NbDaysReboot=round((now() - LastReboot )/(3600*24), 0) 
| eval LastLogon=strftime(LastLogon, "%y-%m-%d %H:%M") 
| eval LastReboot=strftime(LastReboot, "%y-%m-%d %H:%M") 
| lookup test.csv HOSTNAME as host output SITE 
| stats values(LastReboot) as "Last reboot date" values(NbDaysReboot) as "Days without reboot" values(LastLogon) as "Last logon date" values(NbDaysLogon) as "Days without logon" by host SITE 
| rename host as Hostname, SITE as Site 
| sort -"Days without reboot" -"Days without logon"
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;From this search, I have created an alert which is a litthe different because I match the date with a new index&lt;BR /&gt;Thats the reason why I use a join command&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;[|`tutu` earliest=-30d latest=now 
| lookup toto.csv NAME as AP_NAME OUTPUT Building 
| stats last(AP_NAME) as "Access point", last(Building) as "Geo building" by host 
| join host type=outer 
    [|`LastLogonBoot` earliest=-30d latest=now 
    | eval SystemTime=strptime(SystemTime, "'%Y-%m-%dT%H:%M:%S.%9Q%Z'") 
    | stats latest(SystemTime) as SystemTime by host EventCode 
    | xyseries host EventCode SystemTime 
    | rename "6005" as LastLogon "6006" as LastReboot 
    | eval NbDaysReboot=round((now() - LastReboot )/(3600*24), 0) 
    | eval LastReboot=strftime(LastReboot, "%y-%m-%d %H:%M") 
    | lookup test.csv HOSTNAME as host output SITE BUILDING_CODE DESCRIPTION_MODEL ROOM STATUS 
    | stats last(LastReboot) as "Last reboot date", last(NbDaysReboot) as "Days without reboot", last(DESCRIPTION_MODEL) as Model, last(SITE) as Site, last(AP_NAME) as "Access point", last(BUILDING_CODE) as Building, last(ROOM) as Room, last(STATUS) as Status by host ] 
| search Site = titi 
| rename host as Hostname 
| table Hostname Model Status "Days without reboot" "Last reboot date" Site Building Room "Access point" "Geo building" 
| sort -"Days without reboot"
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My question is the following :&lt;BR /&gt;When I execute the search, I have some events that doesnt exists in my alert even if they sholud exist&lt;BR /&gt;How to explain that? Is it due to the join command?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 23:32:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-lost-event-with-join-command/m-p/482045#M142988</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-07-23T23:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: help on lost event with join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-lost-event-with-join-command/m-p/482046#M142989</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;

&lt;P&gt;Let me explain the working of &lt;CODE&gt;join&lt;/CODE&gt; command.&lt;BR /&gt;
Let's call, search query before &lt;CODE&gt;join&lt;/CODE&gt; as main-search and the other as sub-search.&lt;/P&gt;

&lt;P&gt;As your query is missing some events, the possibilities are,&lt;BR /&gt;
- In case of outer join, the result will include all the events from main-search and only matching events from sub-search. Now if the field used with join command is not available in sub-search, those events will not be available.&lt;BR /&gt;
- There limit on results returned by sub-search. While using &lt;CODE&gt;join&lt;/CODE&gt; command, the sub-search will only return 50,000 events. In you case, you are searching for 30 days span, so may be the sub-search event out is greater than 50,000.&lt;/P&gt;

&lt;P&gt;For more details you can refer to - &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Join"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Join&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;accept and up-vote the answer if it helps.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 09:39:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-lost-event-with-join-command/m-p/482046#M142989</guid>
      <dc:creator>gaurav_maniar</dc:creator>
      <dc:date>2020-03-04T09:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: help on lost event with join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-lost-event-with-join-command/m-p/482047#M142990</link>
      <description>&lt;P&gt;Hi thanks for this information, is there another command allowing to return more than 50000 events?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 10:14:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-lost-event-with-join-command/m-p/482047#M142990</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-03-04T10:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: help on lost event with join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-lost-event-with-join-command/m-p/482048#M142991</link>
      <description>&lt;P&gt;The limit is global for sub-searches. You can change the limit from &lt;CODE&gt;limits.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[join]
subsearch_maxout = 50000

[searchresults]
maxresultrows = 50000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(but it strongly not recommended, as it highly affects the Splunk performance) &lt;/P&gt;

&lt;P&gt;Another workaround is, in single search you can include all your data source (index, sourcetypes) ans use &lt;CODE&gt;stats&lt;/CODE&gt; to combine the results for desired output.&lt;BR /&gt;
You can check the following thread for more info,&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/146633/how-to-join-large-tables-with-more-than-50-000-rows-in-splunk.html"&gt;https://answers.splunk.com/answers/146633/how-to-join-large-tables-with-more-than-50-000-rows-in-splunk.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 11:12:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-lost-event-with-join-command/m-p/482048#M142991</guid>
      <dc:creator>gaurav_maniar</dc:creator>
      <dc:date>2020-03-04T11:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: help on lost event with join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-lost-event-with-join-command/m-p/482049#M142992</link>
      <description>&lt;P&gt;ok thanks to you&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 12:12:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-lost-event-with-join-command/m-p/482049#M142992</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-03-04T12:12:50Z</dc:date>
    </item>
  </channel>
</rss>

