Splunk Search

How to display Total Count inside a Chart

virgilg
Explorer

Hi,

I have a search like this:

sourcetype=syslog AND host="xxx.xxx.xxx.xxx" AND mpkg | stats count by username, operation | sort count

This gives me a nice graph, which I've added to a Dashboard:
alt text

However, I would love to get a total count of the Downloads operation be displayed inside the graph, like a Legend of sorts, which will show total downloads were e.g. "157 events" (the count of matches as displayed by the Search view).

How can I do that?

Thanks,
Virgil

1 Solution

somesoni2
SplunkTrust
SplunkTrust

If you're using Splunk 6.3+ version, they try something like this (see the token setting in <done> tag and usage in panel title)

<form>
  ......
  <row>
    <panel>
      <table>
        <title>Total Results: $resultcount$</title>
        <search>
          <query>sourcetype=syslog AND host="xxx.xxx.xxx.xxx" AND mpkg | stats count by username, operation | sort count</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        <done>
          <eval token="resultcount">$job.resultCount$</eval>
        </done>
        </search>
      ........
      </table>
    </panel>
  </row>
.......
</form>

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

If you're using Splunk 6.3+ version, they try something like this (see the token setting in <done> tag and usage in panel title)

<form>
  ......
  <row>
    <panel>
      <table>
        <title>Total Results: $resultcount$</title>
        <search>
          <query>sourcetype=syslog AND host="xxx.xxx.xxx.xxx" AND mpkg | stats count by username, operation | sort count</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        <done>
          <eval token="resultcount">$job.resultCount$</eval>
        </done>
        </search>
      ........
      </table>
    </panel>
  </row>
.......
</form>

vravisplunker
Explorer

This idea worked for me, thanks somesoni2

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...