Dashboards & Visualizations

Dashboard for Server Status

Uday
Explorer
How to display the below query results in a better way on a dashboard?

| metasearch index=_internal | eval host=lower(host) | stats count BY host | append [ | inputlookup perimeter | eval host=lower(host), count=0 | fields host count ] | stats sum(count) AS total BY host | eval status=if(total=0,"Down","Up") | table host status

 

Labels (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

Depends on how many you have in that table - what do you want to convey?

You can colour the Status column green/red for up/down

You could do a 

| stats values(host) as Hosts by Status

to have a single value field for all the up/down hosts and then colour the row accordingly using one of the simple JS extensions from the dashboard examples.

You could display a simple percentage counter of those hosts up vs down and then drilldown into the relevant category - in that way you're not displaying a list of names any more, you're representing a metric, in which case you can then use different visualisations to show that ratio.

But it all depends on your viewpoint of 'better'

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Uday,

as I said in a different answer, install the Splunk Dashboard Examples App.

Then copy in $SPLUNK_HOME/etx/apps/your_app/ two files that you can find in the app:

  • "table_icons_rangemap.js",
  • "table_decorations.css"

and then (after Splunk restart) try something like this:

<form script="table_icons_rangemap.js" stylesheet="table_decorations.css">
  <label>Home Page</label>
  <fieldset submitButton="false">
    <input type="time" token="Time">
      <label>periodo</label>
      <default>
        <earliest>@d</earliest>
        <latest>now</latest>
      </default>
    </input>
  </fieldset>
  <row>
    <panel>
      <title>Servers</title>
      <table id="table1">
        <title>Total = $server_count$</title>
        <search>
          <progress>
            <set token="server_count">$job.resultCount$</set>
          </progress>
          <cancelled>
            <unset token="server_count"></unset>
          </cancelled>
          <query>
            | metasearch index=_internal
            | eval host=lower(host)
            | stats count BY host
            | append [ | inputlookup perimeter | eval host=lower(host), count=0 | fields host count ]
            | stats sum(count) AS total BY host
            | eval status=if(total=0,"Down","Up")
            | table host status
          </query>
          <earliest>$Time.earliest$</earliest>
          <latest>$Time.latest$</latest>
        </search>
        <option name="count">100</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="refresh.display">progressbar</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
    </panel>
  </row>
</form>

 Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...