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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...