All Apps and Add-ons

Is there an Environment Token present that contains the user role?

edoardo_vicendo
Contributor

Hi All,

We are writing a javascript to inquiry a lookup table and we would like to use the user role instead of the user (see token $env:user$). We have checked in the documentation which are the available tokens described at the folllowing link:

http://docs.splunk.com/Documentation/Splunk/7.0.3/Viz/tokens#Use_global_tokens_to_access_environment...

But we would like to know if it is present a token for the user role, or if there is any other way to retrieve this information and use then in a javascript.

Thanks a lot,
Edoardo

0 Karma

elliotproebstel
Champion

This query, which you could run in the background on a dashboard containing JavaScript, will return the username and roles for the user accessing the dashboard:

| rest splunk_server=local /services/authentication/current-context 
| table username roles
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...