Dashboards & Visualizations

Token Flicking to 0 then the number i needed



I am using a base search to display a token.

However, I noticed it flicks to 0 then the number I need.

I need something like this -  <!--condition match=" $result.count$ != 0"--> but there is also a case where I need it to be 0. So how can I get it to display the number only when the job is 100% done. I have tried done, finalised but they all display the 0 at the wrong time and then it changes to the correct number.

i have also tried to add in  <condition match=" $job.resultCount$ == 1"> but I still get the 0 and then the number I need


<search base="basesearch_MAIN">
    <!-- FInd out how many process are being monitored -->
    <query>| stats count </query>
      <set token="Token_no_of_Process">$result.count$</set>





Labels (1)
0 Karma

Path Finder


I have unset token Token_no_of_Process whenever there is a change in Time Picker. Due to this,  the value of the token would be set every time, as the base search will be executed due to a change in the token.


Also, if you calculate value when by appending | stats count then even if the output is zero job.resultCount will have value 1 (because one result with value zero is returned). Hence it would be preferable to calculate in the base search query.


Can you try the below solution?

  <search id="basesearch_MAIN">
    <query>index="_internal" | dedup sourcetype | table sourcetype</query>
  <fieldset submitButton="false">
    <input type="time" token="time_token" searchWhenChanged="true">
        <unset token="Token_no_of_Process"></unset>
    <panel depends="$never_show_this_panel$">
        <title>Test Count</title>
        <search base="basesearch_MAIN">
            <condition match="'job.resultCount'==0">
              <set token="Token_no_of_Process">Zero Count</set>
              <set token="Token_no_of_Process">Non-Zero</set>
    <panel depends="$Token_no_of_Process$">
        <title>Test Count $Token_no_of_Process$ </title>
        <search base="basesearch_MAIN">
          <query>| stats count</query>




This seems to work and thanks for your answer.


Robert Lynch

Tags (1)
0 Karma
.conf21 Now Fully Virtual!
Register for FREE Today!

We've made .conf21 totally virtual and totally FREE! Our completely online experience will run from 10/19 through 10/20 with some additional events, too!