Dashboards & Visualizations

Token reference works in panel title but same reference fails in Dashoboard label

Vebloud
Explorer

I am using token cc in dashboard panel title and it is working. Same token in dashboard label is not working. What am I doing wrong?
My code:

<dashboard stylesheet="my_style.css">&gt;<label>Daily Country Dashboard $cc$</label>
  <description>This is a testing dashboard for every country</description>
  <row>
    <panel>
      <title>Input $cc$</title>
      <single>
        <search>

alt text

0 Karma

vnravikumar
Champion

Hi

I tried a small example with js, Hope it will help you.

<dashboard script="rk.js">
  <label>Total values:</label>
  <row>
    <panel>
      <table>
        <search>
          <query>index="_internal" |stats count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <done>
            <set token="count">$result.count$</set>
          </done>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
</dashboard>

Js:

require([
     "splunkjs/mvc",
     "splunkjs/mvc/simplexml/ready!",
 ], function(mvc) {
     $(document).ready(function () {
         var title = $('h2[data-view="views/dashboard/header/Title"]').text();
         var defaultTokenModel = mvc.Components.get("default");
         defaultTokenModel.on("change:count", function(newTokenName, count, options) {
         var temp = title +" " + count;
         $('h2[data-view="views/dashboard/header/Title"]').text(temp)
          });
     });
 });
0 Karma

vnravikumar
Champion
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...