Dashboards & Visualizations

How to use environment default tokens in HTML Dashboards?

ppatrikfr
Path Finder

Hi Splunkers, I'm trying to use $env:user_realname$ in a HTML dashboard, I've searched a lot about It and realize that I could only get this information with a SplunkJs function but I only get this until now:

var tokens = mvc.Components.getInstance("default");       
           var current=Splunk.util.getConfigValue("USERNAME");        
           tokens.set("currentuser", current);

The code above only brings me my username and I want full name (or realname, as Splunk use to reference).

Thanks everyone!

0 Karma

poete
Builder

Hello @ppatrikfr .

Did you have a look at @loggar answer to this question (https://answers.splunk.com/answers/290292/get-current-user-and-their-roles-from-splunkjs.html). It seems to do the trick!

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 ...