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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...