Dashboards & Visualizations

hideSplunkBar leaves no way to log out

grittonc
Contributor

I'm very new to this, so I'm sorry if this question is obvious.

I'm trying to give some users access to only their app. They have no need for the settings menu, or the app menu. However, it seems that I can't hide these selectively. The only way to hide them seems to be to use hideSplunkBar="true" in the simple XML dashboards. This hides the whole SplunkBar, including the user menu where they can log out. This seems clunky.

Is there a way to selectively hide Splunk Bar items, like the Apps menu and the settings menu?

Tags (2)
0 Karma
1 Solution

niketnilay
Legend

@grittonc, try adding the code like the following to your dashboard. This will give you an HTML Pane with the Logout button on the right (you can style through CSS). You can save this as a pre-built panel and include in the dashboards for your app:

  <row>
    <panel>
      <html>
        <div>
          <a href="http://<YourSplunkServerURL>/en-US/account/logout" class="btn" style="float:right;">Logout</a>
        </div>
      </html>
    </panel>
  </row>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

niketnilay
Legend

@grittonc, try adding the code like the following to your dashboard. This will give you an HTML Pane with the Logout button on the right (you can style through CSS). You can save this as a pre-built panel and include in the dashboards for your app:

  <row>
    <panel>
      <html>
        <div>
          <a href="http://<YourSplunkServerURL>/en-US/account/logout" class="btn" style="float:right;">Logout</a>
        </div>
      </html>
    </panel>
  </row>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

grittonc
Contributor

Thanks. Do I have to convert my whole dashboard to HTML to accomplish this?

0 Karma

niketnilay
Legend

@grittonc, just take the above code and paste above the first <row> section you currently have.

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

micahkemp
Champion

No, you do not.

If this works for you, please accept the answer so this question no longer looks open. Obviously ignore that advice if this answer doesn't fully solve your problem.

0 Karma

neelshah
Path Finder

how does this work for Splunk "Search" page. I am not able to implement this on Search Page. Implemented on all other dashboards

0 Karma

niketnilay
Legend

@neelshah, Since this option is based on <html> panels which can be added only to a dashboard, if you want to implement this also for Search, you will have to create your own Search dashboard using Splunk JS stack and code all your Dashboard Drilldown to point to your Search dashboard rather than Splunk Search UI.

Refer to my answer which describes how you can create your own Search Dashboard using Splunk JS Stack: https://answers.splunk.com/answers/586948/how-to-change-app-banner-css-when-open-search-in-s.html

Moreover this question is regarding adding our own logout link, when we hide Splunk App Bar with default logout link. So this also implies in Splunk Search Bar you will have Splunk App Bar. You can refer to above option which was originally asked to apply custom theme to Search UI. Which implies in Splunk Search implemented as Dashboard you can also hide the Splunk App Bar.

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

Improve Your Security Posture

Watch NowImprove Your Security PostureCustomers are at the center of everything we do at Splunk and security ...

Maximize the Value from Microsoft Defender with Splunk

 Watch NowJoin Splunk and Sens Consulting for this Security Edition Tech TalkWho should attend:  Security ...

This Week's Community Digest - Splunk Community Happenings [6.27.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...