Dashboards & Visualizations

How to insert text in an HTML panel based on user input in text forms without showing the name of the tokens on the dashboard?

guillecasco
Path Finder

I have this simple HTML panel as a title of a chart. This chart shows some values depending on the tokens that are referred in some text box on the top of the dashboard. By default, when you access the dashboard in the html panel chart title you have:

Events  for  $Client_Version|s$ and Asset ID $id|s$

Thing is I don't want to show the name of the tokens when someone accesses the dashboard. I would like to have:

Events for:       

and then, depending on the values that a user enters in both text boxes, the value of that title should be changed with those values. It is working fine now, so if you enter something in the text boxes, the HTML panel changes to: text1: A text2: B

Events for: A and B 

but when you access the dashboard for the first time, by default it has the token's name which I think no one should see.
I tried with value, but I'm getting something like:

Events  for:  $Client_Version|s$ and Asset ID $id|s$  Events for: 

Events for appears two times: in title and in the default value that I put.

How can I solve this?
thanks

            <h1>

              Events  for:  $Client_Version|s$ and Asset ID $id|s$

            </h1>
        </html>
0 Karma
1 Solution

sundareshr
Legend

Not sure there is a way to do this without writing script or hiding the panel till the token is set. My recommendation would be to add `depends="$tokenname$" to your panel tag so the entire panel stays hidden till the token value is set. If you must show the chart panel, but are OK with hiding the title, you could add a HTML panel about the chart panel and hide that till token is set.

http://docs.splunk.com/Documentation/Splunk/6.4.1/Viz/PanelreferenceforSimplifiedXML#panel

View solution in original post

sundareshr
Legend

Not sure there is a way to do this without writing script or hiding the panel till the token is set. My recommendation would be to add `depends="$tokenname$" to your panel tag so the entire panel stays hidden till the token value is set. If you must show the chart panel, but are OK with hiding the title, you could add a HTML panel about the chart panel and hide that till token is set.

http://docs.splunk.com/Documentation/Splunk/6.4.1/Viz/PanelreferenceforSimplifiedXML#panel

guillecasco
Path Finder

that´s a better idea. I will just hide it till values are entered. thanks

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Free Professional Services for .conf26 Attendees

This year at .conf26, we are doing something a little different. We are bringing the best minds from ...

Defend at Machine Speed: Your Guide to Security Sessions at .conf26

Splunk .conf26   With threats moving at machine speed and attack surfaces expanding across hybrid ...

Where Innovation Takes Flight: The Splunk4Aviation Flight Sim Lands at .conf26

If you hear someone at .conf26 shouting "gear down, GEAR DOWN" across the show floor, you have found us.  The ...