Dashboards & Visualizations

How to change roles to run a specific search?

Jannakin
New Member

I have a lookup which contains varying information which is linked to a user field in the lookup. I need a way to to be able to allow users to see this lookup but only see the rows which are linked to their user account.

I can do this in search by using a rest command to pull the users user name and match this to the user field but there's nothing stopping them from just removing the rest line and seeing everything thats in that lookup. I've also tried moving the data into an index and having the rest built into the search filter but splunk doesn't allow subsearches in searchfilter so this also doesn't work.

So i need a way to auto apply the filter whenever anyone tries to access the lookup and/or index, I believe there may be a way to use python to add a role which will allow them to run the filtered search on a dashboard and then remove the role once the search has been completed but my knowledge of python is nil. 

Has anyone got any experience with building or working with something similar?

 

| inputlookup lookup.csv
| search
    [| rest /services/authentication/current-context/context
    | table username
    | rename username as user]

Labels (3)
0 Karma
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...