Dashboards & Visualizations

External HTML links

Ant1D
Motivator

Hey,

I would like to add some buttons or links to the viewHeader section of a view so that when clicked, a new window is opened that displays an external web page (e.g. google.com)

Can this be done?

Thanks in advance for your help.

Tags (3)
0 Karma
1 Solution

Ant1D
Motivator

Here's an example solution to add some buttons to a view that can be used to display external web pages in a new window when clicked:

Create a .html file (e.g. mybuttons.html) in the following directory:
$SPLUNK_HOME$/etc/apps/$your_app$/appserver/static

Add the following code to your html file:
<div class="YourButtons">
<button type="button" onclick="window.open('http://www.google.com')">Google</button>
<button type="button" onclick="window.open('http://www.yahoo.com')">Yahoo</button>
</div>

To get these buttons displayed in your choosen view (e.g. yourview.xml), go into yourview.xml and add the following module:

<module name="ServerSideInclude" layoutPanel="viewHeader">
<param name="src">mybuttons.html</param>
</module>

This example assumes that you are using Advanced XML.

View solution in original post

Ant1D
Motivator

Here's an example solution to add some buttons to a view that can be used to display external web pages in a new window when clicked:

Create a .html file (e.g. mybuttons.html) in the following directory:
$SPLUNK_HOME$/etc/apps/$your_app$/appserver/static

Add the following code to your html file:
<div class="YourButtons">
<button type="button" onclick="window.open('http://www.google.com')">Google</button>
<button type="button" onclick="window.open('http://www.yahoo.com')">Yahoo</button>
</div>

To get these buttons displayed in your choosen view (e.g. yourview.xml), go into yourview.xml and add the following module:

<module name="ServerSideInclude" layoutPanel="viewHeader">
<param name="src">mybuttons.html</param>
</module>

This example assumes that you are using Advanced XML.

Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

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, ...