Splunk Search

How to create HTML code in separate panels?

Splunk_ZE
Engager

Dears, i have a problem with my dashboard using html inside the <row>. what i want to achieve is having 2  tabs so that when i click on each of them a different query will be executed. the problem is that i have a  separate   html code in each of them and both links appear as active  regardless of the tab i select. i followed this tutorial:

Splunk Dashboard Customization: Create Multiple Tabs Within A Single Dashboard - Splunk on Big Data

my code is :

<dashboard script="tabs.js" stylesheet="tabs.css">
<label>test</label>
<row id="tabs">
<panel>
<html>
<ul id="tabs" class="nav nav-tabs">
<li class="active">
<a href="#" class="toggle-tab" data-elements="tab_Map" data-token="control_token_non_internal" style="color:orangered;font-weight: bolder;">tab1</a>
</li>
<li>
<a href="#" class="toggle-tab" data-elements="tab_Tab2" data-token="control_token_non_internal" style="color:orangered;font-weight: bolder;">tab2</a>
</li>
</ul>
</html>
</panel>
</row>
<row id="tab_Map" >
<panel >

<html >
<a href=...(ommiting this part)><button class="button">tab1</button>

</row>

and another row for the other tab. i get both buttons like below. i want to have only tab1 button when i click on tab1 , not both of buttons. any idea what am i missing

Splunk_ZE_0-1692029431035.png

 

Labels (1)
Tags (2)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

I use this approach for tabs, doesn't need JS and allows you to totally customise the CSS.

This is an example app with techniques in the XML you can use to generate the tabs, using linked list inputs.

https://splunkbase.splunk.com/app/5256

 

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

I have seen a tabs.js that does not currently work with Splunk - not sure if that's the version you're using, however, there is a problem in that you appear to be using the same token for both tabs

control_token_non_internal

 

0 Karma

Splunk_ZE
Engager

hello,

 

i corrected the token but still have same issue. has someone had any success with such ? in other words i want that html to show only for specific panels and to be controlled by a token.

0 Karma

bowesmana
SplunkTrust
SplunkTrust

I use this approach for tabs, doesn't need JS and allows you to totally customise the CSS.

This is an example app with techniques in the XML you can use to generate the tabs, using linked list inputs.

https://splunkbase.splunk.com/app/5256

 

Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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