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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...