<?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: Mvexpand memory usage in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/483469#M4016</link>
    <description>&lt;P&gt;Yes, make sense. Thanks, @starcher &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2019 06:04:22 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-09-19T06:04:22Z</dc:date>
    <item>
      <title>Mvexpand memory usage- How do I troubleshoot this error?</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/483466#M4013</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hello, everyone!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I was encountered with weird problem. I have the following search:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;| tstats `summariesonly` count by source, host, index, sourcetype | table source, host, index, sourcetype | stats values(host) as src_host dc(host) as count by source, index | sort + count 
| mvexpand src_host
| outputlookup sourcescheck
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Long story short, i got the error:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;warn : command.mvexpand: output will be truncated at 5200 results due to excessive memory usage. Memory threshold of 500MB as configured in limits.conf / [mvexpand] / max_mem_usage_mb has been reached.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and my truncated &lt;EM&gt;sourcescheck.csv&lt;/EM&gt;, which size was &lt;STRONG&gt;less then 1Mb&lt;/STRONG&gt; (sic!)&lt;/P&gt;
&lt;P&gt;Ok, we can see in docs (&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.1/SearchReference/Mvexpand):" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.1/SearchReference/Mvexpand):&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;The total necessary memory is the average result size multiplied by the number of results in the chunk multiplied by the average size of the multivalue field being expanded.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My question: is it the practical reality that for processing less that 1Mb of data with &lt;EM&gt;mvexpand&lt;/EM&gt; command we need more than half of 1Gb of memory? Are there some workarounds or optimized approaches?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Thank you for any answers!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 15:44:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/483466#M4013</guid>
      <dc:creator>333_gloom_333</dc:creator>
      <dc:date>2022-06-24T15:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Mvexpand memory usage</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/483467#M4014</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/205470"&gt;@333_gloom_333&lt;/a&gt; &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;less than 1Mb&lt;/STRONG&gt; might be due to partial OR incomplete execution of the search.  Can you please try below search. Hopefully, this will give you all the required rows with the performance improvement. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats `summariesonly` count by source, host, index, sourcetype 
| stats values(host) as src_host dc(host) as count by source, index  | eval n=1 | accum n
| sort + count 
| stats values(*) as * by n,src_host | table sourcetype index src_host count
| outputlookup sourcescheck
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:17:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/483467#M4014</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-09-30T02:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Mvexpand memory usage</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/483468#M4015</link>
      <description>&lt;P&gt;Do not table then stats. Just use the stats removing the table line in the middle. You are breaking the map reduce behavior efficiencies.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 13:02:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/483468#M4015</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2019-09-18T13:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Mvexpand memory usage</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/483469#M4016</link>
      <description>&lt;P&gt;Yes, make sense. Thanks, @starcher &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 06:04:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/483469#M4016</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-09-19T06:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Mvexpand memory usage</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/483470#M4017</link>
      <description>&lt;P&gt;It works. Although i was left disappointed about &lt;EM&gt;mvexpand&lt;/EM&gt; command.&lt;/P&gt;

&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 12:03:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/483470#M4017</guid>
      <dc:creator>333_gloom_333</dc:creator>
      <dc:date>2019-10-04T12:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Mvexpand memory usage</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/603122#M8989</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;I had similar mvexpand truncate error and used below lines&lt;/P&gt;&lt;PRE&gt;| eval n=1 | accum n&lt;/PRE&gt;&lt;PRE&gt;| stats values(*) as * by n,&amp;nbsp;(all&amp;nbsp;the&amp;nbsp;fields&amp;nbsp;that&amp;nbsp;were&amp;nbsp;mentioned&amp;nbsp;in&amp;nbsp;mvexpand)&lt;BR /&gt;I&amp;nbsp;am&amp;nbsp;able&amp;nbsp;to&amp;nbsp;get&amp;nbsp;the&amp;nbsp;results&amp;nbsp;without&amp;nbsp;any&amp;nbsp;warnings/error&amp;nbsp;but&amp;nbsp;can&amp;nbsp;you&amp;nbsp;please&amp;nbsp;explain&amp;nbsp;what&amp;nbsp;is&amp;nbsp;happening&amp;nbsp;in&amp;nbsp;the&amp;nbsp;above&amp;nbsp;line?&lt;/PRE&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 07:39:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/603122#M8989</guid>
      <dc:creator>VijaySrrie</dc:creator>
      <dc:date>2022-06-24T07:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Mvexpand memory usage</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/603128#M8990</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/164779"&gt;@VijaySrrie&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;`mvexpand` has its own limitation (Memory Limit).&amp;nbsp; in most cases `mvexpand` will work like charm but with a huge dataset or resultset, it will break due to this limitation.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On other hand, the `stats` command has the beauty of managing large datasets with awesome performance.&lt;/P&gt;&lt;P&gt;So I have used stats instead of mvexpand.&lt;/P&gt;&lt;P&gt;The challenge was the output should be the same as the result with mvexpand.&lt;/P&gt;&lt;P&gt;So below SPL is the magical line that helps me to achieve it.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval n=1 | accum n&lt;/LI-CODE&gt;&lt;P&gt;This command will number the data set from 1 to n(total count events before mvexpand/stats). and below stats command will perform the operation which we want to do with the mvexpand. which will gives you exact same output.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats values(*) as * by n, (all the fields that were mentioned in mvexpand)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this will help you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 08:25:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/603128#M8990</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2022-06-24T08:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Mvexpand memory usage</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/603138#M8991</link>
      <description>Awesome!!! Thanks a lot!!!</description>
      <pubDate>Fri, 24 Jun 2022 09:14:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Mvexpand-memory-usage-How-do-I-troubleshoot-this-error/m-p/603138#M8991</guid>
      <dc:creator>VijaySrrie</dc:creator>
      <dc:date>2022-06-24T09:14:42Z</dc:date>
    </item>
  </channel>
</rss>

