Splunk Search

What is the difference between $user$ and user=$user$ ?

suspense
Explorer

Hello,

I can see in many Use Cases examples that tokens are using alternately in drill down searches:
$user$ and user=$user$

In both cases the user fields is available in SPL and log fields. Is there any difference with using 
$user$ or user=$user$? If no difference - is something actually better?

Thank you.

Labels (2)
Tags (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Which form to use depends on the context.  A token is just replacement text so use the token the same way you would use the value within the token.  For example, to find events where the user field has the value stored in the $user$ token, use user=$user$.  To find events with any occurrence of the same value, use $user$.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Which form to use depends on the context.  A token is just replacement text so use the token the same way you would use the value within the token.  For example, to find events where the user field has the value stored in the $user$ token, use user=$user$.  To find events with any occurrence of the same value, use $user$.

---
If this reply helps you, Karma would be appreciated.
0 Karma

suspense
Explorer

Hmmm ok, that just makes sense 🙂 I thought there is something more behind this 😄

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...