<?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 What is the best search to display memory usage by host? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-search-to-display-memory-usage-by-host/m-p/352246#M104249</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;
I have some container metrics being logged that are formatted as such:&lt;/P&gt;

&lt;P&gt;Used Memory:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ip=1.2.3.4
event_type=ValueMetric
name=/host/info/memory/used_memory
value=12345
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Available Memory:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ip=1.2.3.4
event_type=ValueMetric
name=/host/info/memory/max_memory
value=12345
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since I have two different fields by name (/host/info/memory/used_memory &amp;amp; /host/info/memory/max_memory), what is the best way to display used_memory as a percentage by the available memory?&lt;/P&gt;

&lt;P&gt;I'd ultimately like to show memory usage over time to build a dashboard. Specifically I'd like to see memory usage by IP, to show spikes in memory usage by IP.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 13:51:44 GMT</pubDate>
    <dc:creator>hippe21</dc:creator>
    <dc:date>2020-09-29T13:51:44Z</dc:date>
    <item>
      <title>What is the best search to display memory usage by host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-search-to-display-memory-usage-by-host/m-p/352246#M104249</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I have some container metrics being logged that are formatted as such:&lt;/P&gt;

&lt;P&gt;Used Memory:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ip=1.2.3.4
event_type=ValueMetric
name=/host/info/memory/used_memory
value=12345
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Available Memory:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ip=1.2.3.4
event_type=ValueMetric
name=/host/info/memory/max_memory
value=12345
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since I have two different fields by name (/host/info/memory/used_memory &amp;amp; /host/info/memory/max_memory), what is the best way to display used_memory as a percentage by the available memory?&lt;/P&gt;

&lt;P&gt;I'd ultimately like to show memory usage over time to build a dashboard. Specifically I'd like to see memory usage by IP, to show spikes in memory usage by IP.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:51:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-search-to-display-memory-usage-by-host/m-p/352246#M104249</guid>
      <dc:creator>hippe21</dc:creator>
      <dc:date>2020-09-29T13:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best search to display memory usage by host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-search-to-display-memory-usage-by-host/m-p/352247#M104250</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;P&gt;In case you chart per some field say _time,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search 
| eval name=mvindex(split(name,"/"),-1)
| chart max(value) by _time name
| eval used_perc=round(used_memory*100/max_memory,2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you just want a single row/value giving you percent,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search 
| eval name=mvindex(split(name,"/"),-1)
| eval {name}=value
| stats max(used_memory) as used_memory max(max_memory) as max_memory
| eval used_perc=round(used_memory*100/max_memory,2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Apr 2017 19:14:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-search-to-display-memory-usage-by-host/m-p/352247#M104250</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-04-27T19:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best search to display memory usage by host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-search-to-display-memory-usage-by-host/m-p/352248#M104251</link>
      <description>&lt;P&gt;Thanks for the reply. I'm going to play around with this a bit. I updated my original request. Ideally I'd like to see memory usage % by IP (there would be 5 nodes with different IP's).&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 13:56:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-search-to-display-memory-usage-by-host/m-p/352248#M104251</guid>
      <dc:creator>hippe21</dc:creator>
      <dc:date>2017-04-28T13:56:24Z</dc:date>
    </item>
  </channel>
</rss>

