<?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 How do I optimize the query to avoid forceful termination ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-the-query-to-avoid-forceful-termination/m-p/582455#M202864</link>
    <description>&lt;P&gt;My query after finalizing for some time , gives me,&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;The search processs with sid= was forcefully terminated because its physical memory usage&amp;nbsp; has exceeded the 'search_process_memory_usage_threshold'&amp;nbsp; setting in limits.conf.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;I am not allowed to increase memory...&lt;BR /&gt;Any suggestion how to tweak the query&amp;nbsp; to avoid forceful termination?&lt;BR /&gt;&lt;BR /&gt;=================&lt;BR /&gt;(index=bsa) sourcetype=wf:esetext:user_banks:db OR sourcetype=wf:esetext:soc_sare_data:db au!="0*"&lt;BR /&gt;| stats values(bank_name) as bank_name&lt;BR /&gt;, values(bank_type) as type&lt;BR /&gt;, values(pwd_expires) as pwd_expires&lt;BR /&gt;, values(is_interactive) as is_interactive&lt;BR /&gt;, values(au_owner_name) as au_owner_name&lt;BR /&gt;, values(au_owner_email) as au_owner_email&lt;BR /&gt;, values(service_bank_name) as service_bank_name&lt;BR /&gt;, values(owner_elid) as owner_elid,&lt;BR /&gt;, values(manager_name) as manager_name&lt;BR /&gt;BY au&lt;BR /&gt;| eval bank_name=coalesce(bank_name,service_bank_name)&lt;BR /&gt;| eval user=lower(bank_name)&lt;BR /&gt;| dedup user&lt;BR /&gt;| rex field=user "[^:]+:(?&amp;lt;user&amp;gt;[^\s]+)"&lt;BR /&gt;| fields - bank_name&lt;BR /&gt;| stats&lt;BR /&gt;values(au_owner_email) as au_owner_email&lt;BR /&gt;, values(au_owner_name) as au_owner_name&lt;BR /&gt;, values(owner_elid) as owner_elid&lt;BR /&gt;, max(manager_name) as manager_name&lt;BR /&gt;BY user&lt;BR /&gt;,service_bank_name&lt;BR /&gt;,type&lt;BR /&gt;,pwd_expires&lt;BR /&gt;,is_interactive&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jan 2022 23:20:07 GMT</pubDate>
    <dc:creator>zacksoft_wf</dc:creator>
    <dc:date>2022-01-25T23:20:07Z</dc:date>
    <item>
      <title>How do I optimize the query to avoid forceful termination ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-the-query-to-avoid-forceful-termination/m-p/582455#M202864</link>
      <description>&lt;P&gt;My query after finalizing for some time , gives me,&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;The search processs with sid= was forcefully terminated because its physical memory usage&amp;nbsp; has exceeded the 'search_process_memory_usage_threshold'&amp;nbsp; setting in limits.conf.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;I am not allowed to increase memory...&lt;BR /&gt;Any suggestion how to tweak the query&amp;nbsp; to avoid forceful termination?&lt;BR /&gt;&lt;BR /&gt;=================&lt;BR /&gt;(index=bsa) sourcetype=wf:esetext:user_banks:db OR sourcetype=wf:esetext:soc_sare_data:db au!="0*"&lt;BR /&gt;| stats values(bank_name) as bank_name&lt;BR /&gt;, values(bank_type) as type&lt;BR /&gt;, values(pwd_expires) as pwd_expires&lt;BR /&gt;, values(is_interactive) as is_interactive&lt;BR /&gt;, values(au_owner_name) as au_owner_name&lt;BR /&gt;, values(au_owner_email) as au_owner_email&lt;BR /&gt;, values(service_bank_name) as service_bank_name&lt;BR /&gt;, values(owner_elid) as owner_elid,&lt;BR /&gt;, values(manager_name) as manager_name&lt;BR /&gt;BY au&lt;BR /&gt;| eval bank_name=coalesce(bank_name,service_bank_name)&lt;BR /&gt;| eval user=lower(bank_name)&lt;BR /&gt;| dedup user&lt;BR /&gt;| rex field=user "[^:]+:(?&amp;lt;user&amp;gt;[^\s]+)"&lt;BR /&gt;| fields - bank_name&lt;BR /&gt;| stats&lt;BR /&gt;values(au_owner_email) as au_owner_email&lt;BR /&gt;, values(au_owner_name) as au_owner_name&lt;BR /&gt;, values(owner_elid) as owner_elid&lt;BR /&gt;, max(manager_name) as manager_name&lt;BR /&gt;BY user&lt;BR /&gt;,service_bank_name&lt;BR /&gt;,type&lt;BR /&gt;,pwd_expires&lt;BR /&gt;,is_interactive&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 23:20:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-the-query-to-avoid-forceful-termination/m-p/582455#M202864</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2022-01-25T23:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I optimize the query to avoid forceful termination ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-the-query-to-avoid-forceful-termination/m-p/582458#M202867</link>
      <description>&lt;P&gt;The values function is known to consume a lot of memory so use it carefully.&lt;/P&gt;&lt;P&gt;Consider coalescing bank_name and service_bank_name before the first stats command.&lt;/P&gt;&lt;P&gt;That said, the number of events being processed can also affect how much memory is used.&amp;nbsp; Try shrinking the time period to reduce the number of events.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 00:59:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-the-query-to-avoid-forceful-termination/m-p/582458#M202867</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-01-26T00:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I optimize the query to avoid forceful termination ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-the-query-to-avoid-forceful-termination/m-p/582464#M202869</link>
      <description>&lt;P&gt;It's not clear whether you need to run stats twice. Try to consolidate if possible.&lt;/P&gt;&lt;P&gt;Could be typos here, but you get the idea:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fields bank_name bank_type pwd_expires is_interactive au_owner_name au_owner_email service_bank_name owner_elid manager_name au
| eval user=LOWER(COALESCE(bank_name,service_bank_name))
| rex field=user "[^:]+:(?&amp;lt;user&amp;gt;[^\s]+)"
| rename bank_type AS type
| stats values(au_owner_email) AS au_owner_email, values(au_owner_name) AS au_owner_name, values(owner_elid) AS owner_elid, max(manager_name) AS manager_name last(is_interactive) AS is_interactive last(pwd_expire) AS pwd_expire last(service_bank_name) AS service_bank_name last(type) AS type BY user &lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 26 Jan 2022 02:43:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-the-query-to-avoid-forceful-termination/m-p/582464#M202869</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-01-26T02:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I optimize the query to avoid forceful termination ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-the-query-to-avoid-forceful-termination/m-p/582471#M202872</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190794"&gt;@johnhuang&lt;/a&gt;&amp;nbsp; The first STATS was to perform a join between two sourcetypes by common field "au".&amp;nbsp; If I don't do that I am not able to get values from both the sources,&amp;nbsp; example bank_type is from second source type and is_interactive is from first.&amp;nbsp;&lt;BR /&gt;Also I get some multivalues, so to flatten them out I use them in the second stats's BY clause .&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 04:41:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-the-query-to-avoid-forceful-termination/m-p/582471#M202872</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2022-01-26T04:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I optimize the query to avoid forceful termination ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-the-query-to-avoid-forceful-termination/m-p/582473#M202873</link>
      <description>&lt;P&gt;Try max instead of last for those 2 fields. Since I can't see your data, I'm just making a few guesses and assumptions on how to structure the query. You need to play around with it -- I'm sure you'll be able to get rid of one of the stats.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fields bank_name bank_type pwd_expires is_interactive au_owner_name au_owner_email service_bank_name owner_elid manager_name au
| eval user=LOWER(COALESCE(bank_name,service_bank_name))
| rex field=user "[^:]+:(?&amp;lt;user&amp;gt;[^\s]+)"
| rename bank_type AS type
| stats values(au_owner_email) AS au_owner_email, values(au_owner_name) AS au_owner_name, values(owner_elid) AS owner_elid, max(manager_name) AS manager_name max(is_interactive) AS is_interactive last(pwd_expire) AS pwd_expire max(service_bank_name) AS service_bank_name last(type) AS type BY use&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 05:21:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-the-query-to-avoid-forceful-termination/m-p/582473#M202873</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-01-26T05:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I optimize the query to avoid forceful termination ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-the-query-to-avoid-forceful-termination/m-p/582474#M202874</link>
      <description>&lt;P&gt;If those missing values are defined by au, you can throw in an eventstats to have it filled.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fields bank_name bank_type pwd_expires is_interactive au_owner_name au_owner_email service_bank_name owner_elid manager_name au
| eventstats max(is_interactive) AS is_interactive max(bank_type) AS bank_type BY au
| eval user=LOWER(COALESCE(bank_name,service_bank_name))
| rex field=user "[^:]+:(?&amp;lt;user&amp;gt;[^\s]+)"
| rename bank_type AS type
| stats values(au_owner_email) AS au_owner_email, values(au_owner_name) AS au_owner_name, values(owner_elid) AS owner_elid, max(manager_name) AS manager_name max(is_interactive) AS is_interactive last(pwd_expire) AS pwd_expire max(service_bank_name) AS service_bank_name last(type) AS type BY user &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 05:27:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-the-query-to-avoid-forceful-termination/m-p/582474#M202874</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-01-26T05:27:54Z</dc:date>
    </item>
  </channel>
</rss>

