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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...