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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...