Splunk Search

Display search result as a label text or non editable text on the dashboard

sh254087
Communicator

I am trying to retrieve and display the user name of the logged in user as a label or a non-editable text on the dashboard. 

I'm able to fetch the user name using this query (here I'm limiting this example to 'admin') -

| rest /services/authentication/current-context splunk_server=local
| where user = "admin"
| table user

This search will always return single value.

I now want to display this as a label/ non-editable text on the dashboard - For example, to display on top of the dashboard like

"Logged-in user : admin" 

Can someone please help achieve this? 

Labels (1)
0 Karma

impurush
Contributor

Hi @sh254087 

If you are running the below query in the dashboard, you can set the token in the dashboard.
So, you can use the $token_a$ in your label where you want to display it.

| rest /services/authentication/current-context splunk_server=local
| where user = "admin"
| table user
-------------
<progress>
<set token="token_a">$result.user$</set>
</progress>

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...