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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Enhance Security Operations with Automated Threat Analysis in the Splunk EcosystemAre you leveraging ...

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...