Dashboards & Visualizations

UserID variable

clement
Explorer

Hi There,

I would like to parse the current Splunk login userid via the URL to the next dashboard, may I know what is the variable name?

Regards,
Clement

Tags (1)
0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

You can get the current logged in user by this query

| rest /services/authentication/current-context | search username!="splunk-system-user"| table realname username  roles

Since this can be run in the next dashboard directly, you don't have to pass it, but again depends on what you're trying to do.

View solution in original post

clement
Explorer

Thanks! Somesoni2 for your prompt reply.

I should explain in more detail on my requirement, I have converted my xml based dashboard to HTML, I hide the Launcher navigation bar on the top of the dashboard and created hyperlink to the URL below, but I need to replace the in the hyperlink to allow user to change their password:
https://:8000/en-US/manager/launcher/authentication/changepassword/?action=edit

Could you advice how to grab UserID in HTML dashboard?

Regards,
Clement

0 Karma

somesoni2
SplunkTrust
SplunkTrust

You can get the current logged in user by this query

| rest /services/authentication/current-context | search username!="splunk-system-user"| table realname username  roles

Since this can be run in the next dashboard directly, you don't have to pass it, but again depends on what you're trying to do.

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