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!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...