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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...