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

niketn
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

niketn
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

niketn
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

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

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...