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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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