All Apps and Add-ons

How to find name of the currently logged in user in Splunk Web Framework App?

mshapirovp
Explorer

In a web framework app, is it possible (via javascript) to get the name of the currently logged in user?

I would like to provide this in an ajax call when the user performs an action.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

If you require splunkjs/mvc/sharedmodels then you can run this:

console.log(sharedModels.get("user").entry.get("name"));
console.log(sharedModels.get("user").entry.content.get("realname"));

Produces this output:

"admin"
"Administrator"
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...