Dashboards & Visualizations

Use Token in Dashboard Title

Haybuck15
Explorer

I have a dashboard that is only accessible via drilldown. When drilldown occurs, a hostname is passed to this dashboard, and all filters are set to invisible using the "depends" attribute.

I need to set the title of the dashboard (not a panel within the dashboard, but the dashboard itself) as the hostname that was passed to it. Here's the code I have so far, this is not currently working. Instead, Splunk is presenting the literal text "$server$". Can anyone please help?

<form>
  <label>Windows Monitor > $server$</label>
  <fieldset submitButton="false">
    <input type="text" token="server" depends="$thisTokenDoesNotExist$"></input>
  </fieldset>
  ...
</form>

So when the token passed is "form.server=MYSERVER", I want the dashboard label to display as:

Windows Monitor > MYSERVER

1 Solution

niketn
Legend

@Haybuck15 refer to one of my older answers with a workaround where you would need to

1) Hide the Dashboard Title
2) Move the input to a new panel
3) Create html panel with dashboard title and use token from input.

https://answers.splunk.com/answers/712013/how-do-you-display-the-date-in-a-dashboard-title.html

Please try out and confirm!

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

woodcock
Esteemed Legend

I have never been able to get this to work.

0 Karma

Haybuck15
Explorer

niketnilay actually managed to give me a totally usable workaround, I've already checked it off as the accepted answer. That might help you out too!

0 Karma

niketn
Legend

@Haybuck15 refer to one of my older answers with a workaround where you would need to

1) Hide the Dashboard Title
2) Move the input to a new panel
3) Create html panel with dashboard title and use token from input.

https://answers.splunk.com/answers/712013/how-do-you-display-the-date-in-a-dashboard-title.html

Please try out and confirm!

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

Haybuck15
Explorer

That worked perfectly first shot! I also never realized you could have part HTML and part Simple XML in a panel, for some reason I'd always thought you had to mark that the entire panel was HTML for it to read ANY HTML, no idea why I had that notion.

Thank you so much!

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...