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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...