Splunk Search

Eval eliminated value instead of using NOT in initial search

pepper_seattle
Path Finder

I have a set of data from which I'd like to answer three questions in a single search:
1. Users who open a menu and perform an action
2. Users who open a menu, but perform no action
3. Users who never open the menu

To get results for #2 I need to add a 'NOT' variable to my original search, however I'm hoping that I can actually do it in an eval instead.
Original search:
index=* sourcetype=* NOT clicked
| stats count(opened) by <field>

Note: 'clicked' is a field which unfortunately doesn't contain a 0 or false value

My Question:
I can use a join to get both #1 and #2, but I want to know if there is a way to eval the 'NOT clicked' portion of my search instead of having it eliminate all click values at the start?

Tags (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

You can use the where command in your search to filter results rather than filtering initially. For example: index= sourcetype= | where NOT clicked| stats count(opened) by &lt;field&gt;

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

pepper_seattle
Path Finder

Using the | where NOT clicked would still require me to use a join to get the data for users that opened the menu and clicked because it's limiting the data. I'm looking for (if possible) something like:
| eval opened_clicked=<?>
| eval opened_notclicked=<?>
| eval not_opened=<?>

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...