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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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