Dashboards & Visualizations

Set token in XML dashboard based on result count in scheduled report

sssignals
Path Finder

Hi Splunk community

I have a scheduled report running every 5 mins that ends with "... | stats count". Is there a way based on result count > 0, set token to true in XML dashboard in order to show the panel that depends on the token.

Thanks in advance.

0 Karma

gaurav_maniar
Builder

Hi,

You can add a hidden panel with saved search and use the result count in other search,

<row depends="$hidden$">
    <panel>
      <table>
        <title>Report Name</title>
        <search ref="Saved Search or Alert Name">
          <done>
            <set token="test">$job.resultCount$</set>
          </done>
        </search>
      </table>
    </panel>
  </row>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults | eval test=$test$</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
      </table>
    </panel>
  </row>

Accept & up-vote the answer if it helps.

happy splunking.....!!!!

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@sssignals

Here, I suggest you store count in any lookup and use in your dashbaord to set token.

Like.

.... | stats count | oputputlookup my_lookup

Access lookup data using | inputlookup my_lookup | table count and set token in the dashboard.

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...