Dashboards & Visualizations

How to dynamically change the panel title in dashboard?

abhi04
Communicator

I have a panel which displays the software installed and uninstalled for the last month.
Mow i want the panel title to change dynamically e.g. "Software installed/uninstalled for the month of x" where x is dynamic.

Can someone help me with this?

Tags (1)
0 Karma

thambisetty
SplunkTrust
SplunkTrust

Hi,

Try something like below,

<form>
  <label>test</label>
  <fieldset submitButton="false">
    <input type="time" token="time">
      <label></label>
    </input>
  </fieldset>
  <search id="baseSearch">
    <query>| makeresults | eval earliest=if(match("$time.earliest$","^-"),strftime((relative_time(now(),"$time.earliest$")),"%B"),strftime("$time.earliest$","%B"))</query>
    <earliest>$time.earliest$</earliest>
    <latest>$time.latest$</latest>
    <done>
      <set token="month">$result.earliest$</set>
    </done>
  </search>
  <row>
    <panel>
      <title>Softwares Installed/Unistalled in month of $month$</title>
      <table>
        <search>
          <query>your search</query>
          <earliest>$time.earliest$</earliest>
          <latest>$time.latest$</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">100</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
    </panel>
  </row>
</form>

baseSearch will format the month from earliest time from time range picker. you can choose relative time some thing like last 60 mins or choose date from Date range in both the cases it will work.

Happy Splunking...

————————————
If this helps, give a like below.

thambisetty
SplunkTrust
SplunkTrust

Please do not forget to vote if it works.

————————————
If this helps, give a like below.
0 Karma

HiroshiSatoh
Champion

Set the search result as a token and realize it.

Please refer to the answer of Mr. somesoni2 of this answer.
https://answers.splunk.com/answers/463937/how-to-reference-a-dashboard-token-in-an-html-pane.html

0 Karma

HiroshiSatoh
Champion

Where do you get the year / month information? Is the search result?

0 Karma

abhi04
Communicator

@HiroshiSatoh

Yes, I have a panel which tells the software installed and uninstalled on a server and its date for last month. so it shows in the result

0 Karma
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...