Splunk Search

How to exclude from stats

chuckeelos
New Member

Hello,

I'm trying to exclude the results that I obtain from this search. Essentially, this yields all bots hitting my web server. Now I'm trying to exclude this results so it shows me, hopefully, all human hits. I've been trying to do | stats count (eval(NOT match . . . , but I cannot for the life of me figure it out. Thanks!

sourcetype="access_combined" host="www7*"
| eval usersession=clientip + "_" + useragent
| sort usersession, _time | delta _time as visit_pause p=1
| streamstats current=f window=1 global=f last(usersession) as previous_usersession
| eval visit_pause=if(usersession==previous_usersession, visit_pause, -1) | search visit_pause!=-1

Labels (1)
Tags (1)
0 Karma

chuckeelos
New Member

Unless the answer is to use: 

| eval visit_pause=if(usersession==previous_usersession, visit_pause, -1) | search NOT visit_pause!=-1

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...