Splunk Search

How to dynamically set a variable for Dashboard Panel Title?

GaryZ
Path Finder

I am looking to dynamically update the Splunk Dashboard panel title, depending on options I've chosen from a dropdown menu in Splunk Dashboard.

I've tried the following

  <row>
    <panel>
      <title>Panel1: (Hardware: $hardware1$ - $unit_used$</title>
        ...
        <search base="main_search">
          <query>
          ...

          | eval _unit_used = "ms"
  
          </query>
          <done>
            <set token="unit_used">$result._unit_used$</set>  
          </done>
        </search>

 

 

However when the script runs, I am seeing

"Hardware: abc - $result.unit_used$".

instead of seeing

"Hardware: abc - ms"

 

Is there a way of achieving this?

Thanks

Labels (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

I suspect the title is set before any searches run so there are no results from which to pull a field value.

OTOH, if the value for the title comes from a drop-down then you should use a form token instead of a results token.

$form._unit_used$
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...