Dashboards & Visualizations

How to remove search button below the panel and search capabilities as well

varad_joshi
Communicator

I have couple of related things to be addressed. 

  • I want to remove the search button from the panels so that users from specific roles can only see the dashboards.

 While the 'user' cannot see the search button, I want admins to see that option. 

So putting <option name="link.openSearch.visible">false</option> in the XML is ruled out. 

Is there any other way?

 

  • I do not want users to have the search capabilities as well. If I am doing that, the searches in dashboards are also not working. Can I make them see the dashboards but take away the capabilities of running the ad-hoc searches? 

 

 

Labels (1)
Tags (1)
0 Karma

niketn
Legend

@varad_joshi you can refer to one of my older answers to use logged in user role in Splunk Dashboard and enable/disable required inputs for non-admins:https://community.splunk.com/t5/Security/Can-i-restrict-permissions-for-the-text-box-drilldown-input.... In your case you would need to hide the Open in Search link.

  <init>
    <set token="searchShowHideCSS">visibility: hidden !important;</set>
  </init>
  <search>
    <progress>
      <!-- No Results Found - Hence admin role is attached with logged in user enable Open in Search Link-->
      <condition match="$job.resultCount$==0">
        <set token="searchShowHideCSS"></set>
      </condition>
      <!-- Hence admin role is not attached with logged in user -->
      <condition>
        <set token="searchShowHideCSS">visibility: hidden !important;</set>
      </condition>
    </progress>
    <query>| rest splunk_server=local /services/authentication/current-context 
| fields username roles 
| eval roles=mvjoin(roles,",") 
| search roles!="admin"</query>
    <earliest>$earliest$</earliest>
    <latest>$latest$</latest>
  </search>
  <row depends="$alwaysHideCSSPanel$">
    <panel>
      <html>
        <style>
          a[data-original-title="Open in Search"]{
            $searchShowHideCSS$
          }
        </style>
      </html>
    </panel>
  </row>

For the second question you may have to provide more details. If you can provide users with results from a predefined Report or Scheduled search you can use the loadjob command, hence abstracting the underlying search. Users can have access to the report but not to search.

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

dionrivera
Communicator

Any suggestions how to do this in Studio using json? Thank you.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

This thread is over three years old, is not related to Dashboard Studio, and involves a user who is no longer on the forum.  Please post a new question.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...