Dashboards & Visualizations

another problem to display $tokens$ with a default value

crazyeva
Contributor

Hi, my page string :

<form>
  <panel>
    <search>
      <query>
        index=_internal earliest=-1h
       |stats c
      </query>
      <preview>
        <set token="to_display">$result.c$</set>
      </preview>
    </search>
    <html>
      <h1>total: $to_display$</h1>
    </html>
  </panel>
</form>

when query excuted, on the xml page will correctly display the 'stats count value' as total:200
but before that , when the token is not set yet, it shows total:$to_display$ directly for a while then changes to its value, could i hide the token name or set it with a default value such as "-" ?

Tags (3)
0 Karma

chimell
Motivator

Hi crazyeva
use exactly this xml code i tested it , it works well

<dashboard>
  <label>tok-essai</label>
  <row>
    <panel>
      <table>
        <search>
          <query>index="_internal" |stats c</query>
          <earliest></earliest>
          <latest></latest>
          <preview>
         <set token="to_display">$result.c$</set>
       </preview>
        </search>
      </table>
      <html>
       <h1>total: $to_display$</h1>
     </html>
    </panel>
  </row>
</dashboard>
0 Karma

chimell
Motivator
i think that if total:$to_display$ appear directly it is because progress bar go slowly
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 ...