Security

How to show different views by the type of user

AngusLi
New Member

Hello everyone:
My idea is: There are three types of users, I would like to show different views who the the types of user .
Can this do with Splunk?

Tags (2)
0 Karma

chimell
Motivator

Hi
try this

 index=_internal  | rex "\/app\/(?<myApp>\w+)\/(?<myView>\w+)\"" | stats  values(myView) AS myViews by user 
0 Karma

AngusLi
New Member

thanks for you help,that should be good.I will be try!

0 Karma

somesoni2
SplunkTrust
SplunkTrust

One option could be to create 3 roles for your 3 user types. In your app, create three views, one for each user type and then set the sharing permission of each view to grant Read permission to specific role only. The limitation of this approach is that you can't set these views as default view for user. This works fine if they are present in the navigation menu.

0 Karma

Rocket66
Communicator

As Martin Müller said ...

You can use Javascript to find out which user/role a user have and you can manage your views/content depending on that user :

http://answers.splunk.com/answers/91302/getting-user-role-in-javascript

There are several mechanisms to control the content depending on user/roles ...

eg. (http)redirect to (static)views, change (some) content within a view using JQuery, using Ajax to load entire content in panels, ...

0 Karma

Ayn
Legend

Sure. Create a role for each type of user, then create three different apps and set them as the defaults for the respective user role. Then you're free to customize each app for each user type.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust
0 Karma

AngusLi
New Member

Yes,but i was not found the doc of SplunkJS/Webframework

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You could build one default view for everyone, and use SplunkJS/Webframework code or SideviewUtils' Multiplexer module to show/hide parts of the view depending on the current user's role.

0 Karma

Ayn
Legend

No, you can't set different views as default for different users within an app.

0 Karma

AngusLi
New Member

Dear friend:
This is not what i want, i mean just have one app, not more.
but thanks your answer!

0 Karma
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 ...