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!

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!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...