<?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 help on basic eval in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-on-basic-eval/m-p/475846#M145898</link>
    <description>&lt;P&gt;hi&lt;/P&gt;

&lt;P&gt;why "MemoryUsage" doenst return any results?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eval FreeMemory = round(Value, 0). " MB" 
| eval TotalMemory = round((TotalPhysicalMemory / 1024 / 1024), 0). " MB" 
| eval MemoryUsage = (TotalMemory - FreeMemory) / TotalMemory
| stats last(FreeMemory) as "Free Memory", last(TotalMemory) as "Total memory", values(MemoryUsage) as "Memory Usage" by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is anybody can help me??&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2020 12:11:01 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2020-02-18T12:11:01Z</dc:date>
    <item>
      <title>help on basic eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-basic-eval/m-p/475846#M145898</link>
      <description>&lt;P&gt;hi&lt;/P&gt;

&lt;P&gt;why "MemoryUsage" doenst return any results?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eval FreeMemory = round(Value, 0). " MB" 
| eval TotalMemory = round((TotalPhysicalMemory / 1024 / 1024), 0). " MB" 
| eval MemoryUsage = (TotalMemory - FreeMemory) / TotalMemory
| stats last(FreeMemory) as "Free Memory", last(TotalMemory) as "Total memory", values(MemoryUsage) as "Memory Usage" by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is anybody can help me??&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 12:11:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-basic-eval/m-p/475846#M145898</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-02-18T12:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: help on basic eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-basic-eval/m-p/475847#M145899</link>
      <description>&lt;P&gt;Because you have added &lt;CODE&gt;MB&lt;/CODE&gt; to FreeMemory and TotalMemory in your early evals they are no longer numeric, so you cant do maths on them any more.&lt;/P&gt;

&lt;P&gt;remove the &lt;CODE&gt;."MB"&lt;/CODE&gt; from the earlier evals, and add it to them at the end:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| eval Free Memory='Free Memory'."MB", Total memory='Total memory'."MB", Memory Usage='Memory Usage'."MB"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;thus:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval FreeMemory = round(Value, 0)
 | eval TotalMemory = round((TotalPhysicalMemory / 1024 / 1024), 0)
 | eval MemoryUsage = (TotalMemory - FreeMemory) / TotalMemory
 | stats last(FreeMemory) as "Free Memory", last(TotalMemory) as "Total memory", values(MemoryUsage) as "Memory Usage" by host
 | eval Free Memory='Free Memory'."MB", Total memory='Total memory'."MB", Memory Usage='Memory Usage'."MB"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Feb 2020 12:25:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-basic-eval/m-p/475847#M145899</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2020-02-18T12:25:17Z</dc:date>
    </item>
  </channel>
</rss>

