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!

Splunk Observability Cloud | Unified Identity - Now Available for Existing Splunk ...

Raise your hand if you’ve already forgotten your username or password when logging into an account. (We can’t ...

Index This | How many sides does a circle have?

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

Registration for Splunk University is Now Open!

Are you ready for an adventure in learning?   Brace yourselves because Splunk University is back, and it's ...