Dashboards & Visualizations

Pass stats count value from a search command to a token, and display tokens in an HTML panel

dojiepreji
Path Finder

Hello all,

Is there a way to pass the number derived from stats count to a token?

I need to make an HTML panel consisting of text like so:

Incident
New VS. Resolved
o   42 new incidents
o   54 resolved incidents (all P3 and P4s)

Values 42 and 54 come from search queries like so:

For 42:
| search status="*"
| stats count(ticket) as New

For 54:
| search status="Resolved"
| stats count(ticket) as Resolved

Is there a way to pass the values of New and Resolved from the search queries to tokens in the dashboard so I can display it inside my HTML panel?

0 Karma

vnravikumar
Champion

Hi @dojiepreji

Try like

       <search>
          <query>your query......| search status="*"
                | stats count(ticket) as New</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <done>
            <condition>
              <set token="new_incident">$result.New$</set>
            </condition>
          </done>
        </search>
0 Karma

vnravikumar
Champion

@dojiepreji, have you tried?

0 Karma

vnravikumar
Champion

Any update?

0 Karma

woodcock
Esteemed Legend
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...