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!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...