All Apps and Add-ons

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

Communicator

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#Useglobaltokenstoaccessenvironmentinformation

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

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