Dashboards & Visualizations

Can I use a hyperlink inside a html panel of a dashboard to set or unsest a token? Hyperlink for set a token.

jtroncoso
Explorer

Can I use a hyperlink inside a html panel of a dashboard to set or unsest a token?
I want the users click on a href link in the dashboard for set or unset token to show or hide another panel in the same dashboard.
Is it possible to do this using href link?
How can I do this with a hyperlink in an html panel of a dashboard?
Example: href="set token=$showPanel2$"**
Hyperlink for set a token.
Help me. Please.

0 Karma
1 Solution

niketn
Legend

@jtroncoso, if you want to stick to Simple XML Dashboard you should check out
Splunk Link List form input which should take care of this: http://docs.splunk.com/Documentation/Splunk/latest/Viz/EventHandlerReference#link

You can also check out Splunk Dashboard Examples app from Splunkbase which has Link Switcher example: https://splunkbase.splunk.com/app/1603/

Only if there is any limitation with Splunk's Link input and you have to set tokens based on clicked hyperlink in HTML panel, you would need to do so using Simple XML JavaScript extension with jQuery to trap click event of the hyperlink and set the token using SplunkJS stack: http://dev.splunk.com/view/webframework-developapps/SP-CAAAEW3

Please let us know if Link input does not cater your need and why. We could then assist you with some sample code for JavaScript Extension.

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

View solution in original post

0 Karma

niketn
Legend

@jtroncoso, if you want to stick to Simple XML Dashboard you should check out
Splunk Link List form input which should take care of this: http://docs.splunk.com/Documentation/Splunk/latest/Viz/EventHandlerReference#link

You can also check out Splunk Dashboard Examples app from Splunkbase which has Link Switcher example: https://splunkbase.splunk.com/app/1603/

Only if there is any limitation with Splunk's Link input and you have to set tokens based on clicked hyperlink in HTML panel, you would need to do so using Simple XML JavaScript extension with jQuery to trap click event of the hyperlink and set the token using SplunkJS stack: http://dev.splunk.com/view/webframework-developapps/SP-CAAAEW3

Please let us know if Link input does not cater your need and why. We could then assist you with some sample code for JavaScript Extension.

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

jtroncoso
Explorer

I have look how to do this very good in the example "Custom Token Links" of the application "Splunk Dashboard Examples". I have been able to do what I want.
Now I can use a hyperlinks inside a html panel of a dashboard to set or unsest a token.
Thank you very much.

niketn
Legend

Glad you were able to find the exact example you needed. Even I had forgotten about it. The example uses SplunkJS stack for setting and un-setting tokens.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...