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!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...