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
Revered Legend

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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...