<?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: How to improve search performance with join alternative? Query frequently times out due to subsearch time limit in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-improve-search-performance-with-join-alternative-Query/m-p/592293#M206158</link>
    <description>&lt;P&gt;It's quite straightforward to get this into a single search, by searching data_set_1 OR data_set_2 then evaluating the data set in the stats command like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;host=prod* sourcetype=log4j (source=user-activity.log ID=uniqueID MESSAGE="LOGIN_SUCCESS*") OR (source=server.log MESSAGE="[Dashboard User-Facing*" ID=uniqueID)
| stats sum(eval(if(MESSAGE="LOGIN_SUCCESS", 1, 0))) as Logins sum(eval(if(source=server.log, 1, 0))) as Errors by Full_Date, ID, DName, STATE 
| eval %=round((100*Errors)/Logins,0) 
| table ID, DName, Full_Date, STATE, Errors, Logins,%&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the stats/eval you are checking for the message login success to indicate a login data event and then the source for the error data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2022 23:19:06 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2022-04-04T23:19:06Z</dc:date>
    <item>
      <title>How to improve search performance with join alternative? Query frequently times out due to subsearch time limit</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-improve-search-performance-with-join-alternative-Query/m-p/592289#M206156</link>
      <description>&lt;P&gt;I have a query that frequently times out due to the subsearch time limit. I'd like to improve it's performance but I'm not sure how. Here's my query:&lt;/P&gt;
&lt;P&gt;host=prod* source=user-activity.log sourcetype=log4j ID=uniqueID MESSAGE="LOGIN_SUCCESS*"| stats count as Logins by Full_Date, ID, DName, STATE | join type=left ID [ search host=prod* source=server.log&amp;nbsp; sourcetype=log4j MESSAGE="[Dashboard User-Facing*" ID=uniqueID | stats count as Errors by Full_Date ,ID, DName, STATE ]|eval %=round((100*Errors)/Logins,0) |table ID, DName, Full_Date, STATE, Errors, Logins,%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 21:00:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-improve-search-performance-with-join-alternative-Query/m-p/592289#M206156</guid>
      <dc:creator>JackNY07</dc:creator>
      <dc:date>2022-04-04T21:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to improve search performance with join alternative? Query frequently times out due to subsearch time limit</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-improve-search-performance-with-join-alternative-Query/m-p/592293#M206158</link>
      <description>&lt;P&gt;It's quite straightforward to get this into a single search, by searching data_set_1 OR data_set_2 then evaluating the data set in the stats command like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;host=prod* sourcetype=log4j (source=user-activity.log ID=uniqueID MESSAGE="LOGIN_SUCCESS*") OR (source=server.log MESSAGE="[Dashboard User-Facing*" ID=uniqueID)
| stats sum(eval(if(MESSAGE="LOGIN_SUCCESS", 1, 0))) as Logins sum(eval(if(source=server.log, 1, 0))) as Errors by Full_Date, ID, DName, STATE 
| eval %=round((100*Errors)/Logins,0) 
| table ID, DName, Full_Date, STATE, Errors, Logins,%&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the stats/eval you are checking for the message login success to indicate a login data event and then the source for the error data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 23:19:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-improve-search-performance-with-join-alternative-Query/m-p/592293#M206158</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-04T23:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to improve search performance with join alternative? Query frequently times out due to subsearch time limit</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-improve-search-performance-with-join-alternative-Query/m-p/592303#M206162</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;Thank you!&lt;/P&gt;&lt;P&gt;Quick question though. How would I dedup just 1 of the 2 searches by SESSID?&amp;nbsp; stats dc? I had previously used&amp;nbsp; eventstats dc(SESSID) as Errors but can't seem to work it into the new search.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 01:20:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-improve-search-performance-with-join-alternative-Query/m-p/592303#M206162</guid>
      <dc:creator>JackNY07</dc:creator>
      <dc:date>2022-04-05T01:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to improve search performance with join alternative? Query frequently times out due to subsearch time limit</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-improve-search-performance-with-join-alternative-Query/m-p/592311#M206163</link>
      <description>&lt;P&gt;Depends on what that dedup is supposed to be doing. Is SESSID a unique session ID that is found in errors and are you trying to count unique sessions with errors?&lt;/P&gt;&lt;P&gt;Do both data sets have a SESSID field?&lt;/P&gt;&lt;P&gt;If you want to get unique sessions for the error data set, the something like this in the existing stats command&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;dc(eval(if(source="server.log", SESSID, null()))) as SessionsWithErrors&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;which is saying if it is the errors data set (source=server.log) then return the SESSID from that event otherwise return null. dc will then count unique sessions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 05:34:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-improve-search-performance-with-join-alternative-Query/m-p/592311#M206163</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-05T05:34:15Z</dc:date>
    </item>
  </channel>
</rss>

