Dashboards & Visualizations

Single Value: Current Server RAM Usage

mxanareckless
Path Finder

I need a Single Value widget for a dashboard which displays current RAM usage in real-time.
This is what I have so far in SPL:

index=index host=host sourcetype=vmstat memUsedMB=*
| stats count

And this is all I'm getting:

mxanareckless_0-1612998574373.png

How can I get something more like this? :

mxanareckless_1-1612998636785.png

 

Labels (3)
0 Karma
1 Solution

manjunathmeti
SplunkTrust
SplunkTrust

hi @mxanareckless,
Check if this works for you.

<dashboard>
  <label>Memory Usage</label>
  <row>
    <panel>
      <single>
        <title>Memory</title>
        <search>
          <query>index=index host=host sourcetype=vmstat memUsedMB=*
| stats latest(memUsedMB) as memUsedMB
| eval totalMem=10000 , freeMemPerc=(100*(totalMem-memUsedMB))/totalMem</query>
          <earliest>rt-1m</earliest>
          <latest>rt</latest>
          <progress>
            <set token="perc">$result.freeMemPerc$</set>
          </progress>
        </search>
        <option name="refresh.display">progressbar</option>
        <option name="showSparkline">0</option>
        <option name="showTrendIndicator">0</option>
        <option name="underLabel">Free $perc$ %.</option>
      </single>
    </panel>
  </row>
</dashboard>

 

If this reply helps you, an upvote/like would be appreciated.

View solution in original post

manjunathmeti
SplunkTrust
SplunkTrust

hi @mxanareckless,
Check if this works for you.

<dashboard>
  <label>Memory Usage</label>
  <row>
    <panel>
      <single>
        <title>Memory</title>
        <search>
          <query>index=index host=host sourcetype=vmstat memUsedMB=*
| stats latest(memUsedMB) as memUsedMB
| eval totalMem=10000 , freeMemPerc=(100*(totalMem-memUsedMB))/totalMem</query>
          <earliest>rt-1m</earliest>
          <latest>rt</latest>
          <progress>
            <set token="perc">$result.freeMemPerc$</set>
          </progress>
        </search>
        <option name="refresh.display">progressbar</option>
        <option name="showSparkline">0</option>
        <option name="showTrendIndicator">0</option>
        <option name="underLabel">Free $perc$ %.</option>
      </single>
    </panel>
  </row>
</dashboard>

 

If this reply helps you, an upvote/like would be appreciated.

renjith_nair
SplunkTrust
SplunkTrust

Probably you should use

index=index host=host sourcetype=vmstat memUsedMB=*
| timechart max(memUsedMB) as memUsedMB

 

Happy Splunking!
0 Karma
Get Updates on the Splunk Community!

There's No Place Like Chrome and the Splunk Platform

Watch On DemandMalware. Risky Extensions. Data Exfiltration. End-users are increasingly reliant on browsers to ...

The Great Resilience Quest: 5th Leaderboard Update

The fifth leaderboard update for The Great Resilience Quest is out &gt;&gt; &#x1f3c6; Check out the ...

Devesh Logendran, Splunk, and the Singapore Cyber Conquest

At this year’s Splunk University, I had the privilege of chatting with Devesh Logendran, one of the winners in ...