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
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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...